TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 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 (139266 times)
  2. FAT32 Library (71754 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47432 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42408 times)
  7. GSM click (29835 times)
  8. mikroSDK (28101 times)
  9. PID Library (26886 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: 6057 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

Let's make - Breathalyser

6

Is there such a thing as the Ballmer peak? It's the idea that moderate alcohol consumption has a benefitial impact on creativity, and hence, on programming ability. The theory was explained in this issue of the xkcd webcomic. We devised a practical test to examine the validity of the assumption.

[Learn More]

Microwave Click

0

Microwave Click detects movement, thanks to the PD-V11 a 24GHz microwave motion sensor. The typical use for Microwave Click is a proximity or motion detector in various applications and devices.

[Learn More]

AlphaNum G 2 Click

0

AlphaNum G 2 Click is a compact add-on board that represents an easy solution for adding numeric or hexadecimal displays to your application. This board features the LTP-3862, a dual-digit 16-segment alphanumeric green display from Lite-ON. It is a 0.3” (7.62mm) display with black face and white segments. The LED segments use common anodes, and besides segments, the decimal point (DP) dot is also available.

[Learn More]