ok, we just got back a couple days ago from Detroit Regional and now I have couple questions.
is it necassary to use a speed controller on ALL motors, or can i (legally) use a spike for the window motor?
if i have to use a speed controller, then what (for example) would i do to make a motor used to power a wench as far as coding goes? (ie, if i wanted to use the p2_sw_aux1 to retract the wench, would i say:
when we used a speed controller, for some odd reason, the motor would activate and start retracting the wench. when we swapped it out for a spike (and changed the code accordingly), it worked out beautifully.
can anyone help out.
sorry if this post sounds jumbled, im kind of in a hurry. any help would be thanked greatly.
This may or may not be related, but i have found that lots of joystick buttons seem to flicker IE not giving a constant stream of 1’s when they are being pressed. Our code now checks the button over the period of 3 or 4 frames to make sure its really pressed. This is probably a good idea for a winch button anyway, you wouldnt want it accidentally pressed.
This code looks valid, except you are missing semicolons at the end of the “pwm05 = XXX” statements. Also, I’m not sure if this applies to the new controller, but the old controller didn’t like PWMs being set to 255 – we were told to use 254 instead.
I’d be willing to bet this was probably caused by some code error that you accidentally remedied when you changed to the Spike. If you posted the exact old and new code, we might be able to better help you.
255 is not a valid output for pwms (victors) - it can make the communcation between your code and the layer above it lose synch
254 is the max you should ever output
that might be why your victor wacked out
or it could be it wasnt calibrated correctly - if you are certain you are sending it 127 and the motor is still trying to move, then it either needs to be recalibrated, or its not working correctly.
to answer your original question, it says in the robot section of the manual which motors you can use with spikes - Im almost certain a window motor would be ok.
wow! im impressed that you discovered that by yourself!
Its called ‘switch bounce’ - when you close a switch or pushbutton it takes about a 1/10th of a second for it to make solid contact - the surfaces actually do bounce a tiny bit - so if a fast microprocessor is polling the switch it will see it go 00001101010011110111111011111111111
and your timing is right - 3 frames is about a 100 mS
I will add that, in our code we had values of 255 being output and weird things were happening. I chnaged it after I saw something on here and the problem went away. At the same time I also changed something else, so it may be a coincidence though.
We had our winch motor controled by a spike. At the AZ regional inspection they told us all moters MUST be controlled by a controler, not a spike. We swapped them out and we use code like yours, except our max was 254.
ok, i guess then we’ll stick with a controller. sorry about the code i posted above. i ALWAYS forget to place those semi-colons there, then when i try to build the code, it fails and i instantaniously know what happened. i should really get some help for that problem (anyone want to start a support group…lol). ok, i’ll try to make those changes when we get to canada. man i wish i was a real programmer…lol. thanks people!