View Single Post
  #6   Spotlight this post!  
Unread 30-01-2008, 21:51
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: ir sensor Board ??????????????????????

Quote:
Originally Posted by Team2002 View Post
I was trying the following for our IR board and nothing seems to happen
Code:
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?
Yes. The valid range of values for a pwm output is 0-254. Since the pwm "variables" in the code are of type unsigned char, trying to set one to 256 will actually end up with it set to zero.

Quote:
This snippet was placed in the user_routines.c
is that the correct place or should it be under user_routines_fast.c?
You'll need to be a lot more specific about where you put the code. The filename is not really important. What matters is the name of the function in which it appears: Process_Data_From_Master_uP(), Default_Routine(), Process_Data_From_Local_IO(), etc.