What I am trying to do must be very simple, but it has me beat at present.
I have a small RF controller that simply puts out a signal and switches a relay on and off.
When the button is pressed on the transmitter the relay is on, but when I release the button the relay is off.
I want to have the relay stay on until I press again, so I thought I could use a picaxe to do that.
I have a small 08M2+ board already made that I could use that has a mosfet output on C.0 and an input on pinC.3
I envisaged using the toggle command to switch the mosfet on and off by means of the transmitter sending a signal to it's own relay which would act as a switch on pinC.3.
The code I started to prepare that has got me beat is shown below, I am at a loss to work it out.
The object is to switch on a mains powered light that has a very hard to reach switch, so I wanted to use a remote to be able to switch it on and off.
I have a small RF controller that simply puts out a signal and switches a relay on and off.
When the button is pressed on the transmitter the relay is on, but when I release the button the relay is off.
I want to have the relay stay on until I press again, so I thought I could use a picaxe to do that.
I have a small 08M2+ board already made that I could use that has a mosfet output on C.0 and an input on pinC.3
I envisaged using the toggle command to switch the mosfet on and off by means of the transmitter sending a signal to it's own relay which would act as a switch on pinC.3.
The code I started to prepare that has got me beat is shown below, I am at a loss to work it out.
The object is to switch on a mains powered light that has a very hard to reach switch, so I wanted to use a remote to be able to switch it on and off.
Code:
#Picaxe 08M2
#No_Data
;C.0 SSR
;pinC.3 toggle pin
symbol SSR = C.0
main:
low C.0
If pinC.3 = 1 then change
goto main
change:
toggle SSR
goto main