- Presets:
- setfreq m8
- 'Double the clock freqency to double the serial comms baud rate
- poke $90, 5
- 'Detune the internal clock oscilator (experiment with values 0 to 10)
- 'Choose the value that is lowest that works reliably then add one or 2
- 'to this
- Read_RFID:
- serin 3,N2400,b0,b0,b0,b0,b1,b2,b3,b4,b5 'reads the card/tag
- setfreq m4 ' reset to 4mhz to allow for onscreen debug
- debug b0 'Use on-screen debug to determine Card Numbers
- serout 0,N2400,(#b0,9,#b1,9,#b2,9,#b3,9,#b4,9,#b5,13,10)
- Check_List:'checks the cards numbers
- if b1<>246 then
- goto Wrongcard
- endif
- if b2=30 then
- goto Card
- endif
- if b2=94 then
- goto Tag
- endif
- goto Read_RFID
- Card:'just a last check to make sure its the right card
- if b4<>19 then
- goto Wrongcard
- endif
- if b5=159 then
- goto Correct
- endif
- goto Read_RFID
- Tag: 'just a last check to make sure its the right card
- if b4<>82 then
- goto Wrongcard
- endif
- if b5=191 then
- goto Correct
- endif
- goto Read_RFID
- Correct:'right card so action.
- toggle 1 ' green LED
- toggle 2 ' Solid state relay
- goto Read_RFID
- Wrongcard:
- toggle 4 'red lED
- pause 2000
- toggle 4
- goto Read_RFID
RFID Keyless Ignition
Posted on August 17, 2010, 7:34 am UTC by Jake Saunders (about 1 year ago)Code (highlighted for Text)
Comments
Code for Keyless ignition. Picaxe 08M and ID-12.