TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (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 (136947 times)
  2. FAT32 Library (70063 times)
  3. Network Ethernet Library (56015 times)
  4. USB Device Library (46332 times)
  5. Network WiFi Library (41952 times)
  6. FT800 Library (41264 times)
  7. GSM click (29050 times)
  8. mikroSDK (26472 times)
  9. PID Library (26444 times)
  10. microSD click (25408 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: 5526 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

Heart Rate 7 click

5

Heart Rate 7 click is an optical biosensor Click board which can be used for heart-rate monitoring (HRM). This Click board employs a very sensitive analog front-end IC with high dynamic range, which ensures accurate and reliable readings.

[Learn More]

Smart Buck 4 click

0

Smart Buck 4 Click is a compact add-on board that contains a high-frequency synchronous step-down DC-DC converter. This board features the LTS3562, a quad synchronous step-down DC-DC regulator from Analog Devices.

[Learn More]

ADC 8 click

0

ADC 8 Click is a high precision, low-power, 16-bit analog-to-digital converter (ADC), based around the ADS1115 IC.

[Learn More]