infrain2 help (alarm&remote)

deeplee

New Member
hey i have tried programming my 08m with the infrain2 command, but just don't succeed. :mad:

here is my infrain2 commands...

main:
wait 5 'dont really need this
goto mainalarm

mainalarm:
infrain2
if infra < 5 then warning1
if infra > 5 then mainalarm
if infra = 5 then turnoff
goto mainalarm

warning1:
high 1
wait 1
infrain2
if infra =5 then turnoff
low 1
infrain2
if infra =5 then turnoff
if infra < 5 then warning2
if infra > 5 then mainalarm

warning2:
high 1
infrain2
if infra =5 then turnoff
wait 1
infrain2
if infra =5 then turnoff
low 1
infrain2
if infra =5 then turnoff
if infra < 5 then alarm
if infra > 5 then mainalarm

alarm:
infrain2
if infra =5 then turnoff
high 1
infrain2
if infra =5 then turnoff
wait 1
goto alarm

turnoff:
infrain2
if infra =5 then main
low 1
goto turnoff






please help.. i have tried different 08m's and IR receiver

this was actually my school project but i got to hand it in in 3 days:( so Ill make something els, unless someone can help me. but i would still like to do this project in my private time, if someone could help me please
 

hippy

Ex-Staff (retired)
Simplify and try this ...

#Picaxe 08M
#Terminal 4800
Pause 2000
SerTxd( "Please press a key ...", CR, LF )
Do
InfraIn2
SerTxd( #infra, CR, LF )
Loop

After download the Terminal window should open, you should see the "Please press a key" message and the key codes of the remote keys pressed should be shown.

If that doesn't work, first things to check ...

* IR receiver wired to wrong pin
* IR receiver circuit not correct
* PICAXE / IR receiver power supply voltage too low
* Batteries flat in remote control
* Remote control not sending SONY IR Codes
 
Top