View Single Post
  #13   Spotlight this post!  
Unread 30-04-2008, 17:48
Generalx5's Avatar
Generalx5 Generalx5 is offline
Hard Core Inventor
AKA: Jun(John) Zheng
FRC #1346 (Trobotics)
Team Role: Student
 
Join Date: Nov 2005
Rookie Year: 2004
Location: CANADA
Posts: 94
Generalx5 will become famous soon enough
Re: Need help with PWM 1-2ms pulse control

Well. Forget about that, I dont know why, but im leaving it as:

pwm01 = (long) Get_Analog_Value(rc_ana_in01) * 254 / 22;

This actually works out to 0 being full reverse, and 254 being full forward, and 127 bing neutral.

My analog inputs read 0 - 22 for some reason.

Thats the easy part, heres the harder part.

What do I need to do to make the PWM outputs respond like this:



So set A and Set B represents the PWM values, it can be either one as a result of a simple switch.

And according to the adjustments on the pot, the speed on the servo varies in equal magnitude in either direction. If the pot is moved towards the top, The servo can be spining real fast depending on the switch. if the pot is near the bottom but not dead bottom. The servos can spin slowly in either direction, again, depending on the switch.

Has anyone attemped this before? Im totally clueless to where to start with this.

Last edited by Generalx5 : 30-04-2008 at 17:52.