View Single Post
  #5   Spotlight this post!  
Unread 30-04-2008, 15:47
billbo911's Avatar
billbo911 billbo911 is online now
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,358
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Need help with PWM 1-2ms pulse control

Quote:
Originally Posted by Mark McLeod View Post
The old EDU robot controller has analog inputs with values from 0 to 1023.
The pwm outputs are sent values from 0 to 254.
So just scale the input to match the output like so
Code:
pwm01 = (long) Get_Analog_Value(rc_ana_in01) * 254 / 1023;
Wouldn't it be just as accurate to do this?

Code:
pwm01 = Get_Analog_Value(rc_ana_in01)/4;
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist