|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Using a switch with a victor
I know that the CIM motors must be attached to a victor we want to turn the motor on to a constant speed with a switch instead of using a joystick. I know we did it several years ago by changing the code but it was with the old controller that used BASIC. Can't remember how we did it any pointers would be greatly appreciated.
|
|
#2
|
|||||
|
|||||
|
Re: Using a switch with a victor
have an if statement in code that is something like:
if(p1_sw_trig == 1) { pwm04 = 255; } else { pwm04 = 127; } and then it will be on full speed or at neutral and still going through a victor |
|
#3
|
|||
|
|||
|
Re: Using a switch with a victor
Try something like this:
Code:
if(switch = open){
if(motor speed < 255){
motor speed += User_Acceleration;
}
if(switch = cosed){
if(motor speed > 127){
motor speed -= User_Acceleration;
}
}
}
Good luck. **Props to Drew Shapiro (huge white kid with a 'fro) for comming up with this scheme.** - He doesn't like it when I steal his code. Last edited by EricWilliams : 30-01-2006 at 20:09. |
|
#4
|
|||||
|
|||||
|
Re: Using a switch with a victor
Try something like this:
pwm01 = 127 + (p1_sw_trig*127) - (p1_sw_top*127); That way, if p1_sw_trig is pressed, the motor will be full forward (254). If p1_sw_top is pressed, it will go full reverse (0). If by mistake you press both buttons, nothing happens - safe! Gotta love one liners ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PRESSURE SWITCH | Mr. Steve | Pneumatics | 20 | 01-12-2005 10:20 |
| Victor 884 problem | Gal Longin | Control System | 11 | 26-01-2005 00:47 |
| LEDs in switch box. | ZZII 527 | Electrical | 5 | 06-03-2004 19:39 |
| Digital Inputs interfering with each other | Bongle | Programming | 8 | 23-02-2004 11:18 |
| Victor 884 Calibration Incorrect | Just3D | Electrical | 4 | 15-02-2004 15:20 |