|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: ir sensor Board ??????????????????????
I was trying the following for our IR board and nothing seems to happen
if (rc_dig_in15 == 1) { pwm_13 = 256; } This was just to test if pressing a button on the remote did anything (the remote was already programmed etc,.) is there anything wrong that we are doing? This snippet was placed in the user_routines.c is that the correct place or should it be under user_routines_fast.c? Thanks for any help |
|
#2
|
||||
|
||||
|
Re: ir sensor Board ??????????????????????
Quote:
I am not 100% positive on this, but here is my thoughts and what to try. The rc_dig_in7 - 18 are tied high when they are set as inputs. If they are considered active when a switch is closed across them to ground, and the output of the IR board goes high when it is active, then you need to test for a !rc_dig_inxx. So try: Code:
if (rc_dig_in15 == 0)
{
pwm_13 = 256;
}
Code:
if (!rc_dig_in15)
{
pwm_13 = 256;
}
Again, I am not a pro at this, just a learner at this point. BTW, the signal will pulse, so hold the button down. |
|
#3
|
||||
|
||||
|
Re: ir sensor Board ??????????????????????
Try this code on a post I made a few days ago. Use MPLAB and add it to the autonomous program. Put whatever you want the robot to do under mode 1 ,mode 2, or mode 3.
http://www.chiefdelphi.com/forums/sh...1&postcount=19 |
|
#4
|
|||||
|
|||||
|
Re: ir sensor Board ??????????????????????
Quote:
Quote:
|
|
#5
|
||||
|
||||
|
Re: ir sensor Board ??????????????????????
Quote:
no......the maximum pwm value is 256......its an extrema |
|
#6
|
||||
|
||||
|
Re: ir sensor Board ??????????????????????
Actually, the maximum PWM value is 255, or 2^8 - 1, which is the maximum value that can be held in 8 bits of memory - the size of an unsigned char. Going above this will cause an overflow problem, where you'll loop around and start at 0 again.
|
|
#7
|
||||
|
||||
|
Re: ir sensor Board ??????????????????????
We were trying to find a way to program the Robot Cotroller so that when any of 2 inputs receive a signal, it will leave the autonomous code and enter a 'maual' autonomous code. The manual autonomous code would work based on 2 if statements that loop back to the other. The if statements would either say left or right and cotinue until our timer value ran out. Our code in the attached file, only makes the motors pulse for some other direction or go to one and continue straight without any further response. Any problems with our coding? Also does anyone know an easier way of accomplishing the same tasks?
Thanks always for the help, Team 2348 |
|
#8
|
|||
|
|||
|
Re: ir sensor Board ??????????????????????
Quote:
I placed it under Default_Routine() is that the wrong place? I couldnt find a function called Process_Data_From_Local_IO(), in user_routines.c |
|
#9
|
|||||
|
|||||
|
Re: ir sensor Board ??????????????????????
If your goal is to test the ability to use IR commands to control motors, that's probably the right place to put it.
But you need to make sure that the pwm outputs you set don't get set to something else later on. You can do that most easily by putting the IR sensing code near the end of the function, so it gets the last opportunity to force the motors to move as you want. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wiring the IR sensor board | govvijay | Programming | 9 | 05-02-2008 19:41 |
| Technical Details for the IR sensor board | tuzzer | Electrical | 1 | 19-01-2008 08:38 |
| How to program ir sensor board?? | RRA4LIFE2 | Programming | 1 | 11-01-2008 21:47 |
| Perf Board = BS2-IC Carrier Board? | indieFan | Electrical | 2 | 16-09-2004 08:28 |
| Making a Sensor Board | SpaceOsc | Technical Discussion | 11 | 15-05-2004 12:46 |