Thread: Pwm and pot
View Single Post
  #2   Spotlight this post!  
Unread 29-01-2006, 15:49
steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: Pwm and pot

Actually, you'd have to do something more like:
Code:
pwm01 = Get_Analog_Value(rc_ana_in01) >> 2;
The controller doesn't sample the analog inputs until you call Get_Analog_Value, and the shift is to convert the 10-bit analog input to the 8-bit PWM output.
__________________
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!