PDA

View Full Version : Sample code for "418 Mhz Receiver-Keychain"



viktor18
07-29-2005, 04:32 PM
I'm looking for a sample code to use the keychain and the receiver (with a bs2) . Is there someone who kindly helps me ?

Thanks a lot !
Viktor18

Jon Williams
07-29-2005, 07:17 PM
There's nothing to it: When you press a button on the fob the corresponding output on the receiver goes high.· If you connect the outputs to P0..P4 you could use this bit of code to monitor the buttons:

btnStatus··· VAR··· Byte

Main:
· btnStatus = INL & %00011111
· DEBUG BIN5 btnStatus, CR
· PAUSE 100
· GOTO Main

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

viktor18
07-29-2005, 07:38 PM
Thank you. i understand it's a simple thing but i'm a newbie about this topic and when i bought the keychain and the receiver there wasn't any instruction with them.
So , thanks again !

Loopy Byteloose
07-30-2005, 01:14 PM
I wanted to latch the recieved outputs so that they are independent of each other.

As it is, the received high signal is only one of four, One goes high and three go low.·

If you want to retain previous high signals rather than reset, you have to do that in your software as toggles·or insert a 74HC112 as four independent toggles.· Either way, they would toggle on the high signal.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
G. Herzog in Taiwan

dandreae
07-30-2005, 09:57 PM
Hi Viktor,

I have some more examples at work, send me an e-mail at dandreae@parallax.com (mailto:dandreae@parallax.com) and I will send you some sample programs.

Dave

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae

Tech Support
dandreae@parallax.com (mailto:dandreae@parallax.com)
http://www.parallax.com

·