IR picaxe upgrade problems

Hi,

i got the infra-red upgrade pack and i connected it up and copied and passed the example code and i keep getting a message: ("infrain" command not supported - use irin!) but when i replace infrain by irin it doesnt work ether .

anybody got any ideas?

 

Here is the code :

main:
infrain 'wait for new signal
if infra = 1 then swon1 'switch on 1
if infra = 2 then swon2 'switch on 2
if infra = 3 then swon3 'switch on 3
if infra = 4 then swoff1 'switch off 1
if infra = 5 then swoff2 'switch off 2
if infra = 6 then swoff3 'switch off 3
goto main
swon1: high 1
goto main
swon2: high 2
goto main
swon3: high 3
goto main
swoff1: low 1
goto main
swoff2: low 2
goto main
swoff3: low 3
goto main

 

 

Make sure you have set the
Make sure you have set the editor in the right mode -> Options -> Check firmware -> Mark the right firmware

Which chip are you using? I

Which chip are you using? I got it to work on a 28x1 and 40x1. Here is the page where I finally got it working after hours of trying. If yours doesn’t work take pictures, tell what chip you are using, and show exactly what remote you are using. Different chips/firmware versions have different ways to do IR.They have changed it a few times.

 

https://www.robotshop.com/letsmakerobots/node/2634

 

I am using thr picaxe 28X1
I am using thr picaxe 28X1 and the editor is in the right mode, already used it loads.

The remote i am using is:
http://194.201.138.187/epages/Store.storefront/?ObjectPath=/Shops/Store.TechSupplies/Products/AXE040
I folowed the instruction on putting it together so i know that that isnt the problem.
I will try your code as soon as my extra 28X1 chips arrive, so in 2 to 3 days. thanks for all the help.

Keep in mind I didnt use the
Keep in mind I didnt use the remote they sell. I bought a $5 universal remote and found a sony settign that worked with the sensor. We are using the same sensor so it should work assuming you have it hooked up properly.

the hooking up bit isnt the
the hooking up bit isnt the problem, for some reasons i can event send the code to the chip.

What do you mean? The remote
What do you mean? The remote isnt working or the chip isn’t receiving? To test the remote take a picture with a digital camera when you press a button. the IR light will show up on the picture. If the chip isnt receiving the sensor may not be hooked up correctly.

i think the problem is in
i think the problem is in the code will have to find out more about the irin comand and variables, but thanks for all the help

infrain

infrain wont work on a 28x1 this is the code from the help menu on the programer this should work fine

main:
irin [1000,main],3,b0 'wait for new signal
if b0 = 1 then swon1 'switch on 1
if b0 = 4 then swoff1 'switch off 1
goto main
swon1: high 1
goto main
swoff1: low 1
goto main

 

this is useing input 3 for ur ir

and a led conected to output 1

 

 

hope this helps

i put the code in, modifided

i put the code in, modifided a bit so insted of a LED it turns a servo. i know the servo code works so. and i put the right code in the remote, C212.

main: irin [1000,main],3,b0 'wait for new signal

if b0 = 1 then swon1 'switch on 1

if b0 = 4 then swoff1 'switch off 1

goto main

swon1: servo 0,125

pause 1000

goto main

swoff1: servo 0,075

pause 1000

goto main

 

hmmm, it seemed soooooo simple but with my luck

reply
sorry iv had a few drinks are you saying this worked or not

not realy,no
not realy,no

**make it simple **

how are you connecting your ir check the help menu on your program editor it will show you how, look at irin in basic commands it will show you how to connect it plus the code a gave you.

i think you said your also useing a universal remote, forget putting codes in this it didnt work for me, your best bet is to search for the code, with the remote i brought i had to change the code for the picaxe as i hade to keep pressing the up button on the remote to find the picaxe. also check your using the right picaxe code. the infrain value is diffrent from the infrain2 value that irin uses.

i am sure that i hooked it

i am sure that i hooked it up correctly
i am not using a universal remote, i am using the one that comes with the upgrade pack.1.

This is what the paper that came with the pack said to do with the remote

Insert 3 AAA size batteries, preferably
alkaline.
2. Press ‘C’. The LED should light.
3. Press ‘2’. The LED should flash.
4. Press ‘1’. The LED should flash.
5. Press ‘2’. The LED should flash and
then go out.

i am staring to think that the code and chip isnt the problem… it might be the remote
as far as i can tell the remote needs a 3 digit code…

it is working, sort

it is working, sort of!

symbol infra = b14
WaitForSignal:

irin 0, infra
debug infra
servo 0,125
PAUSE 250
servo 0,30
GOTO WaitForSignal

thanks to the code from https://www.robotshop.com/letsmakerobots/node/2634 the servo would move when i pushed a button on the remote!

I still need to figure out how to associate a button with a command.

if b14 = whatever code

if b14 = whatever code then

do something

 

or better yet do a switch statement and have it cover a ton of predefined buttons.

IT WORKS !!!symbol infra =

IT WORKS !!!

symbol infra = b14


main:

irin 0, infra
if infra = 0 then s125
if infra = 2 then s60
goto main

s125:
servo 0,125
pause 1000
goto main

s60:
servo 0,30
pause 1000
goto main

there is a slight glitch with the remote or decoding but thats fine for now! button 1 = comand 2 and so on …

what is a switch statement ?