TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139067 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Example

iButton click

Rating:

5

Author: MIKROE

Last Updated: 2018-07-17

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: 1-Wire

Downloaded: 5992 times

Not followed.

License: MIT license  

iButton click - is an iButton probe Click board. The iButton is a technology based on the one-wire communication protocol, and a chip usually packed in a robust stainless steel casing.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "iButton click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "iButton click" changes.

Do you want to report abuse regarding "iButton click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Example Blog

iButton click

iButton click

Native view of the iButton click board.

View full image
iButton click

iButton click

Front and back view of the iButton click board.

View full image
iButton Serial Number

iButton Serial Number

Native view of the iButton Serial Number.

View full image

Library Description

Initializes and defines the GPIO click driver and functions witch turn on or turn off the LED.

Key functions:

  • void ibutton_enableGreenLed(uint8_t state) - The function enables or disables a green LED on click (RST pin) depending on the state of the parameter value.
  • void ibutton_enableRedLed(uint8_t state) - The function enables or disables a red LED on the Click board (CS pin) depending the on the state of the parameter valuer.

Example description

The application is composed of three sections:

  • System Initialization -  Initializes the peripherals and pins.
  • Application Initialization - Initializes the Click board driver.
  • Application Task - Realizes communication between the ibutton and buffer (EEPROM) which includes reading, writing and comparing values.
void applicationTask()
{
 uint8_t check_flag;

 if(!Ow_Reset(OW_PORT, OW_PIN))
 {
 check_flag = Read_Key();
 if(check_flag = 0)
 {
 mikrobus_logWrite("Key exist", _LOG_LINE);
 Delay_ms(500);
 }else
 {
 mikrobus_logWrite("Key doesn't exist", _LOG_LINE);
 Delay_ms(500);
 }
 }
 else
 {
 mikrobus_logWrite("Add new key", _LOG_LINE);

 Delay_ms(500);

 while(Ow_Reset(OW_PORT, OW_PIN))
 {
 if(check_state == 0)
 {
 mikrobus_logWrite("Insert iButton", _LOG_LINE);
 Delay_ms(500);
 check_state = 1;
 }
 }

 check_flag = Add_key();

 if(check_flag == 0)
 {
 mikrobus_logWrite("Key added", _LOG_LINE);
 Delay_ms(500);
 }else
 {
 mikrobus_logWrite("Key already exist", _LOG_LINE);
 Delay_ms(500);
 }

 mikrobus_logWrite("Read iButton", _LOG_LINE);

 check_state = 0;
 }

 Delay_ms(100);
}
  • uint8_t Check_ibutton(uint8_t *ibutton_data) - Compares ibutton data values with buffer data values.
  • uint8_t Check_CRC(uint8_t *ibutton)
  • void Do_something(void) - Enables red LED on click and disables green LED on click.
  • void Do_something_else(void) - Enables green LED on the Click board and disables red LED on click.
  • uint8_t Add_key() - Writes ibutton data to buffer data in first free location.
  • uint8_t * Read_from_EEPROM(uint8_t key_num, uint8_t *buffer_data) - Reads data from the buffer (EEPROM).
  • uint8_t Read_Key() - Reads ibutton data, compares this data with buffer data and depending on the comparison calls other functions to do something.
  • uint8_t Get_Free_Location(uint8_t *buffer_data) - Returns the value of the first free buffer location.
  • void Write_to_EEPROM(uint8_t key_num, uint8_t *buffer_data, uint8_t *ibutton_data) - Writes data to buffer (EEPROM).
  • uint8_t *Get_data() - Realizes One wire communication.


Additional notes and information

Depending on the development board you are using, you may need USB UART clickUSB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

ALSO FROM THIS AUTHOR

7seg click

0

7seg Click is an accessory board in mikroBus form factor. It features two 74HC595 8-bit serial-in, parallel-out shift register modules as well as two seven-segment displays. 7seg Click communicates with target board via SPI interface. The board is designed to use 3.3V and 5V power supply.

[Learn More]

PWM 2 Click

0

This application send the PWM signal in one or more outputs.

[Learn More]

Pressure 16 Click

0

Pressure 16 Click is a compact add-on board that contains a board-mount pressure sensor. This board features the WSEN-PADS (2511020213301), a high-precision MEMS-based digital absolute pressure sensor from Würth Elektronik. It has a fully-calibrated 24-bit pressure output to provide accurate atmospheric pressure data with a configurable host interface that supports both I2C and SPI serial communication and with an intelligent on-chip motion-triggered interrupt feature.

[Learn More]