Dear Picaxe experts, I have a small problem with my program. I want to read an RC signal that is written to the eeprom at a certain position to switch an LED on or off, at the beginning it works fine, but after a short time the LEd doesn't switch on anymore at the programmed point. if i switch off the picaxe and start it again, it works again for a while. i suspect that the eeprom content is lost or overwritten. what can i do?
(attached the program)
Thanks Bruno
Prog:
#picaxe 08M2
setfreq m32 ;Takt intern 32Mhz
symbol Var_a = w1
symbol Var_1 = w10
pause 1000
if pinC.3 = 0 then goto puls
if pinC.3 = 1 then goto impuls_messen
impuls_messen:
pulsin C.4,1,Var_a ; misst Puls an C.4 in Variable Var_a
write Var_a,w1
if pinC.3 = 0 then goto puls
if pinC.3 = 1 then goto impuls_messen
puls:
read Var_a,w1
pulsin C.4,1,Var_1 ; misst Puls an C.4 in Variable w10
if Var_a < Var_1 then goto ein
if Var_a > Var_1 then goto puls
ein:
high C.2 ; Ausgang C.1 auf High setzen
pause 200 ; Pause
low C.2 ; Ausgang C.1 auf Low setzen
pause 6000 ; Pause
goto puls ; loop zurueck zu puls
(attached the program)
Thanks Bruno
Prog:
#picaxe 08M2
setfreq m32 ;Takt intern 32Mhz
symbol Var_a = w1
symbol Var_1 = w10
pause 1000
if pinC.3 = 0 then goto puls
if pinC.3 = 1 then goto impuls_messen
impuls_messen:
pulsin C.4,1,Var_a ; misst Puls an C.4 in Variable Var_a
write Var_a,w1
if pinC.3 = 0 then goto puls
if pinC.3 = 1 then goto impuls_messen
puls:
read Var_a,w1
pulsin C.4,1,Var_1 ; misst Puls an C.4 in Variable w10
if Var_a < Var_1 then goto ein
if Var_a > Var_1 then goto puls
ein:
high C.2 ; Ausgang C.1 auf High setzen
pause 200 ; Pause
low C.2 ; Ausgang C.1 auf Low setzen
pause 6000 ; Pause
goto puls ; loop zurueck zu puls