Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   IR help (http://www.chiefdelphi.com/forums/showthread.php?t=62823)

program1 29-01-2008 20:23

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?

kevin.li.rit 29-01-2008 20:28

Re: IR help
 
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.

popo308 29-01-2008 20:29

Re: IR help
 
Quote:

Originally Posted by program1 (Post 688288)
i have absoulutly no idea how to program the IR. can someone post a sample code so i know what it looks like please?

Are you using MPLab??

program1 29-01-2008 20:32

Re: IR help
 
yea, im using MPLab

popo308 29-01-2008 20:40

Re: IR help
 
Quote:

Originally Posted by program1 (Post 688300)
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

kevin.li.rit 29-01-2008 20:43

Re: IR 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?

popo308 29-01-2008 20:47

Re: IR help
 
Quote:

Originally Posted by Coffeeism (Post 688313)
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....

wt200999 29-01-2008 20:48

Re: IR help
 
Yeah the IR gives you 1's

kevin.li.rit 29-01-2008 20:48

Re: IR help
 
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.

popo308 29-01-2008 20:50

Re: IR help
 
Quote:

Originally Posted by Coffeeism (Post 688322)
I haven't hooked ours up yet. It could be possible the IR receiver board sinks it to 0 when there is no 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

kevin.li.rit 29-01-2008 20:54

Re: IR help
 
Quote:

Originally Posted by popo308 (Post 688326)
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.

popo308 29-01-2008 20:58

Re: IR help
 
Quote:

Originally Posted by Coffeeism (Post 688331)
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

RyanN 29-01-2008 21:59

Re: IR help
 
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)

http://www.chiefdelphi.com/forums/sh...1&postcount=19


All times are GMT -5. The time now is 23:44.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi