1968neil
Senior Member
Hi Guy's,
Just started experimenting with the Dallas ibutton.
The following code works great and does what it does well.
My question is :
How can i get it to read a second key to open the same lock.
The idea is i want access to my workshop and want the second key as a spare but you cant buy another key with the same code ! (or the system would be pointless i suppose).
I am also not sure if the code will all fit into an 08M the basic single key does.
Any advice greatfully received.
Regards
Neil
My code:
main:
let b6 = 0 'reset family code to 0
low 0 'Button LED off
low 1 'Output off
Neilsloop:
toggle 0 ' LED on or off on i probe
if pin3 = 0 then open 'switch pushed
pause 250 'wait 250ms
readowsn 4 'read serial number on input4
if b6 <> 0 then test 'i button detected
goto Neilsloop
' ibutton detected so check code
' if wrong code jump back to start
test:
sound 2,(100,10) 'beep
high 0 'i button probe LED on
if b6 <>$01 then main 'digit pair 8
if b7 <>$43 then main 'digit pair 7
if b8 <>$23 then main 'digit pair 6
if b9 <>$77 then main 'digit pair 5
if b10 <>$13 then main 'digit pair 4
if b11 <>$00 then main 'digit pair 3
if b12 <>$00 then main 'digit pair 2
if b13 <>$94 then main 'digit pair 1
'everything is ok so switch output on for 5 seconds
open:
sound 2, (123,10,124,15,125,10,126,15)
high 1
pause 5000
low 1
goto main
Just started experimenting with the Dallas ibutton.
The following code works great and does what it does well.
My question is :
How can i get it to read a second key to open the same lock.
The idea is i want access to my workshop and want the second key as a spare but you cant buy another key with the same code ! (or the system would be pointless i suppose).
I am also not sure if the code will all fit into an 08M the basic single key does.
Any advice greatfully received.
Regards
Neil
My code:
main:
let b6 = 0 'reset family code to 0
low 0 'Button LED off
low 1 'Output off
Neilsloop:
toggle 0 ' LED on or off on i probe
if pin3 = 0 then open 'switch pushed
pause 250 'wait 250ms
readowsn 4 'read serial number on input4
if b6 <> 0 then test 'i button detected
goto Neilsloop
' ibutton detected so check code
' if wrong code jump back to start
test:
sound 2,(100,10) 'beep
high 0 'i button probe LED on
if b6 <>$01 then main 'digit pair 8
if b7 <>$43 then main 'digit pair 7
if b8 <>$23 then main 'digit pair 6
if b9 <>$77 then main 'digit pair 5
if b10 <>$13 then main 'digit pair 4
if b11 <>$00 then main 'digit pair 3
if b12 <>$00 then main 'digit pair 2
if b13 <>$94 then main 'digit pair 1
'everything is ok so switch output on for 5 seconds
open:
sound 2, (123,10,124,15,125,10,126,15)
high 1
pause 5000
low 1
goto main