Friday, June 7, 2013

Read Dallas iButton Arduino

-Arduino board
-OneWire Library (unzip and copy to arduino-1.0.3/libraries)
-Maxim Ibutton DS1990
-Maxim Touch Probe Read
 Breadboard Connection

 #include <OneWire.h>

OneWire ibutton (2); // I button connected on PIN 2.

byte buffer[20]; //array to store the Ibutton ID.

void setup(){

void loop(){
 if (! (buffer)){//read attached ibutton and asign value to buffer
  for (int x = 0; x<8; x++){  
    Serial.print(buffer[x],HEX); //print the buffer content in LSB. For MSB: for (int x = 8; x>0; x--) 
     Serial.print(" "); // print a space
   Serial.println("\n"); // print new line
   //crc compute//
   byte crc;
   crc = ibutton.crc8(buffer, 7);
/*by Elimeléc

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.