IR help

i have absoulutly no idea how to program the IR. can someone post a sample code so i know what it looks like please?

You plug the IR board into the Digital IO and program it just like you would a switch.

if(!rc_dig_in15)
{command1();
}

Something like that.

Are you using MPLab??

yea, im using MPLab

ok so if you just have

if (rc_dig_in01 == 1)
{
run mottors == XXX
}

then just

if(rc_dig_in02 == 1)
{
run motors == XXX
}

and repeat that for all 4 commands

you just need to tell it was motors to run when you hold the button down…

PM me if you need more help

I thought it gave you a 0 in programing when you sunk the pull ups of the digital IO to ground. Am I wrong?

thats what i thought as well but we hooked ours in and its giving us 1’s…

Yeah the IR gives you 1’s

I haven’t hooked ours up yet. It could be possible the IR receiver board sinks it to 0 when there is no IR signal. Probably what’s happening I guess.

also you are pulsing voltage into the RC where as connecting the pins is a ground to signal connection… that could be why

What I assume is happening is that the output pins on the PIC on the IR board, is set to 0 which would ground the signal on the RC and give a 0. When it sees the IR pulse it changes the output pin to 1 which is a high 5V. That would give you a 1 in programming.

yep exactly

Here is something I wrote in another thread. It’s pretty much completely ready, and will work (as I found out today, because we didn’t have power going our IR board and it came back as an error :D)