|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: IR Sensor
How do you deal with the fact that the inputs are being pulsed on and off at around every 100ms? How does the program keep from repeating multiple times?
|
|
#2
|
||||
|
||||
|
Re: IR Sensor
You may be interested in reading up on "switch debouncing".
|
|
#3
|
||||
|
||||
|
Re: IR Sensor
instead of having it do the actual actions when you press the button you can have it set a variable with the button, then it does a certain routine depending on the button pressed. Example:
Code:
unsigned char test;
if(rc_dig_in01)
test=1;
if(rc_dig_in02)
test=2;
if(rc_dig_in03)
test=3;
if(rc_dig_in04)
test=4;
if(test==1)
(routine a)
etc
|
|
#4
|
|||
|
|||
|
Re: IR Sensor
We haven't actually done anything with the physical IR Sensor, it's just me and my programming partner are new to C and we need some tips on how to program it. We do have mplab.
Also if anyone can help with the yrg, the daa, and the gts, we would greatly appreciate it. |
|
#5
|
||||
|
||||
|
Re: IR Sensor
Quote:
|
|
#6
|
||||
|
||||
|
Re: IR Sensor - Create 100 ms timer loop
Quote:
As long as 100 msec has expired since the last time you ran the loop, it should begin immediately. Last edited by marccenter : 29-01-2008 at 14:52. Reason: Clean up |
|
#7
|
||||
|
||||
|
Re: IR Sensor
here is a link to a copy of the code we wrote in easyc to test our ir board
each button on the remote should turn a different light on the operator interface on for 1 sec and then turn it back off. hope this helps http://whlspacedude.googlepages.com/IRBOARD.zip also make sure you have the ir board hooked up right here is some good info on hooking it up http://www.chiefdelphi.com/forums/sh...26&postcount=5 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| IR Sensor | fabalafae | Programming | 1 | 19-01-2008 16:53 |
| Sensor | Molten | Programming | 3 | 17-02-2007 17:43 |
| Sensor or no Sensor For Autonomous mode | Kyle1010 | Programming | 14 | 22-01-2003 13:10 |
| Sensor Q | Brew | Technical Discussion | 2 | 10-02-2002 12:48 |
| Sensor | Oakridege_665 | Technical Discussion | 5 | 10-01-2002 16:53 |