View Single Post
  #16   Spotlight this post!  
Unread 01-05-2008, 00:34
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

Alright...I've resoldered the pot now, and its working nicely.

....now into the problem with the casting Set A and Set B. Im not sure what you mean by casting 0 - 126 to Set A and casting 127 - 254 to Set B.

Do you mean that When the switch is set to A side, it will only activate PWM pulses between 0 - 126? and the same with side B ( 127-254)?

How should I seperate the pulses into two groups? Ive only been able to get 1 side of it working. I doubled the numerical value of the pot and that gave me the ability to control PWM pulses between 0 - 127. So it would look something like this:

Before pwm01 = (long) Get_Analog_Value(rc_ana_in01) * 254 / 1024;

After pwm01 = (long) Get_Analog_Value(rc_ana_in01) * 254 / 2048;

Im stumped. Sorry for all these questions, Im not a programmer, but I need to figure this out, so any help is much appreciated.