|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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?
|
|
#2
|
|||||
|
|||||
|
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. Last edited by kevin.li.rit : 29-01-2008 at 20:37. |
|
#3
|
||||
|
||||
|
Re: IR help
Are you using MPLab??
|
|
#4
|
||||
|
||||
|
Re: IR help
yea, im using MPLab
|
|
#5
|
||||
|
||||
|
Re: IR help
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 |
|
#6
|
|||||
|
|||||
|
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?
|
|
#7
|
||||
|
||||
|
Re: IR help
thats what i thought as well but we hooked ours in and its giving us 1's....
|
|
#8
|
||||
|
||||
|
Re: IR help
Yeah the IR gives you 1's
|
|
#9
|
|||||
|
|||||
|
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.
|
|
#10
|
||||
|
||||
|
Re: IR help
also you are pulsing voltage into the RC where as connecting the pins is a ground to signal connection... that could be why
|
|
#11
|
|||||
|
|||||
|
Re: IR help
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.
|
|
#12
|
||||
|
||||
|
Re: IR help
yep exactly
|
|
#13
|
||||
|
||||
|
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
)http://www.chiefdelphi.com/forums/sh...1&postcount=19 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Grab Frame - Help Help Help... | nmihailidis | Programming | 2 | 04-03-2007 14:44 |
| section 'InterruptVectorLow' type is non-overlay (was: HELP HELP HELP!!!!!) | naor52 | Programming | 14 | 24-02-2007 01:19 |
| Help: How do we get a teacher to help? (was: Help) | ChaosAlchimey | General Forum | 13 | 21-01-2007 11:57 |