View Single Post
  #6   Spotlight this post!  
Unread 26-02-2007, 18:54
Mr. E Mr. E is offline
Its physics or stamp collecting
FRC #1883
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Las Vegas
Posts: 38
Mr. E is an unknown quantity at this point
Re: Lowering the voltage on a spike

The drives been built. so I can't change the gears on the motors.
Just so I don't look like an absolute ignoramus, I do know how a spike and victor work, I just want to know if its possible.

I know I'm not C savy, so things like
#define DRIVE_SLOW_FWD 155
#define DRIVE_SLOW_REV 99

// other code...

pwm01 = DRIVE_SLOW_FWD;

always seems like an extra step that I don't have to do, especially when I can just say pwm01=155 and put in a comment on the side that reminds me what the line is actually doing.

Okay....
the window turns a motor until it hits a switch. If I use a relay I can use
relay1_fwd = p1_sw_trig & rc_dig_in01; /* FWD only if switch1 is not closed. */
relay1_rev = p1_sw_top & rc_dig_in02; /* REV only if switch2 is not closed. */
in the default code and it will do exactly what I need. (ex. turn right until the switch is hit--rc_dig_in01--, not be able to turn right anymore right, but will be able to turn left until it hits the other switch--rc_dig_in02--)
but of course the motor turns too fast.

If I wire the window to a victor then I have to write new code (thread--Programming a switch) to control the victor in the same fashion. I may have to do it this way, which was a little bit beyond my C skills.
So I decided to go the other route and see if there was a way of just slowing down a victor, but apparently not.
but I might be able to program a victor to work of a joystick button

Last edited by Mr. E : 26-02-2007 at 19:18.