Nickalston
Member
I wonder if someone can help me. I am making a project with two young boys to detect two seperate switches (tilt switches) and am trying to keep it simple. I purchased two sets of AXE213 modules and programmed one of them to work successfully; counting the switch signals on a OLED screen, programme and photo below. (The programme only allows 1 signal to be received every second, as we require for this project). I now want to use the second AXE123 set/module to count the signal from a second switch. Presently, the second transmitter is also received by the first receiver (as expected). Is there a way of solving this problem please?
serout 7,N2400, (254,1) ; clears text
pause 30
serout 7, N2400, (254,128)
serout 7, N2400, ( "Ready to count" )
setint %00000100,%00000100 ; activate interrupt when pin 2 (switch) only goes high
symbol Throw = w0 ;a Throw is a positive signal from the switch
init:
let throw = 0
main:
if pin1 = 1 then
let throw = throw + 1 ; adds a throw to the last one
goto send_data
else
endif
goto main
send_data:
debug
serout 7,N2400, (254,1) ; clears text
serout 7, N2400, (254,128)
serout 7, N2400, ( "Counter " )
serout 7, N2400, (254,136)
serout 7, N2400, ( #Throw ) ; displays throws
pause 1000 ;pause to give the tilt switch chance to settle - delay is no problem
goto main
interrupt:
reset
serout 7,N2400, (254,1) ; clears text
pause 30
serout 7, N2400, (254,128)
serout 7, N2400, ( "Ready to count" )
setint %00000100,%00000100 ; activate interrupt when pin 2 (switch) only goes high
symbol Throw = w0 ;a Throw is a positive signal from the switch
init:
let throw = 0
main:
if pin1 = 1 then
let throw = throw + 1 ; adds a throw to the last one
goto send_data
else
endif
goto main
send_data:
debug
serout 7,N2400, (254,1) ; clears text
serout 7, N2400, (254,128)
serout 7, N2400, ( "Counter " )
serout 7, N2400, (254,136)
serout 7, N2400, ( #Throw ) ; displays throws
pause 1000 ;pause to give the tilt switch chance to settle - delay is no problem
goto main
interrupt:
reset
Last edited: