I am trying to make a reader for ibuttons.
I can't find a good example for what I need. I am looking to read the data in the ibuttons scratchpad memory. The basic part of the code is
spad VAR Byte[16] ' Scratchpad Data
OWOUT portc.0,1,[$CC,$BE] ' send Read Scratchpad
command
OWIN portc.0,2,[STR spad\16] ' read scratchpad
LCDOUT $FE,1, HEX2 spad[0],HEX2 spad[1],HEX2 spad[2],HEX2 spad[3],HEX2 spad[4],HEX2 spad[5],HEX2 spad[6],HEX2 spad[7], HEX2 spad[8],HEX2 spad[9],HEX2 spad[10],HEX2 spad[11],HEX2 spad[12],HEX2 spad[13],HEX2 spad[14],HEX2 spad[15]
When I run code like this or similar the lcd will display
FFFFFFFFFFFFFFFF And when the button is placed it will read
0000000000000000
Any help would be great.
I also plan to convert the results to text once im sure its reading the scratchpad correctly, anytips for that aswell?
Bookmarks