TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 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 (139251 times)
  2. FAT32 Library (71750 times)
  3. Network Ethernet Library (57122 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28077 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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: 6053 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

UVB click

5

UVB Click is based on GUVB-C31SM ultraviolet sensor from GenUV. UVB Click supports integrated functions of ultraviolet light sensors such that can be easily configured and used in user applications.

[Learn More]

ISO 9141 click

5

ISO 9141 Click is a compact add-on board that contains a monolithic bus driver with ISO 9141 interface. This board features the L9637, a monolithic integrated circuit containing standard ISO 9141 compatible interface functions from ST Microelectronics.

[Learn More]

Thermo 5 click

12

THERMO 5 click measures temperature in default range of 0°C to 127°C and extended range of -64°C to 191°C with ±1°C accuracy. It carries the EMC1414 temperature sensor. The click is designed to run on a 3.3V power supply.

[Learn More]