Hey everyone,
I have two breadboards setup with the attached circuits and I am using these transmitter and receiver chips, http://www.sparkfun.com/products/10533 and http://www.sparkfun.com/products/8945. I want to trigger an LED on the receiver side to flash once a mercury switch is tripped on the transmitter side, so pretty simple. I have come a very long way with this project as I have absolutely no prior experience with any of these components or this specific programming language but I am at a bump in the road. I want to flash the LED as long as the mercury switch is connected and when the switch is reset I want the flashing to stop. Here is the code I have for both the transmitter and receiver:
Transmitter code:
Receiver code:
I can get the LED to flash a single time when I hold the switch down but it will not continue flashing. I know there is a programming error somewhere because I am not familiar with how a system like this works with sending the data and everything. I believe the use of an interrupt could permit the function I am looking for but I am not sure how to use it in this situation.
Any help is greatly appreciated! Thanks!
I have two breadboards setup with the attached circuits and I am using these transmitter and receiver chips, http://www.sparkfun.com/products/10533 and http://www.sparkfun.com/products/8945. I want to trigger an LED on the receiver side to flash once a mercury switch is tripped on the transmitter side, so pretty simple. I have come a very long way with this project as I have absolutely no prior experience with any of these components or this specific programming language but I am at a bump in the road. I want to flash the LED as long as the mercury switch is connected and when the switch is reset I want the flashing to stop. Here is the code I have for both the transmitter and receiver:
Transmitter code:
Code:
main:
if pinC.3 = 1 then alarm
goto main
alarm:
SEROUT 2,N4800,(1)
if pinC.3 = 0 then main
goto alarm
Code:
main:
SERIN 3,N4800,b1
if b1 = 1 then flash
goto main
flash:
high C.2
pause 100
low C.2
pause 100
goto main
Any help is greatly appreciated! Thanks!
Last edited: