So this is our first year of using a second side car and its not working… here is the code:
vicShoulder(6,10);
we have power to the second side car and all the lights come on we do not have a light connected to it. we have the the power and connected. when we turn on our robot the victor status light blinks orange. we have tried these things:
switching pwms
swithing the pwm to the first side car and chaning the code
switching ports on the second side car
hooking up one of our jaguras to the pwm in the first side car
Actually dboisvert, I suspect that tomy’s writing his code based off the simple robot class, which doesn’t use pointers, but creates objects directly. For that the syntax would be*:
Someone correct me if I’m wrong, especially tomy if this isn’t how you’re attempting to run the Victor.
I agree on your other points though. I don’t know how many times I’ve forgotten to turn off a motor, or how many times I’ve poured through my code only to discover an electrical failure was the problem.
Also agree with theprgramerdude, more code = more help.
*This was from memory, so it might be off a little. Idea’s the same though.
I believe Code Monkey has it exactly correct. Also, be sure you’re not wiring the PWM cable in backwards to the Victor, as there are no markings if I can remember right on the case. In addition, make sure you initialize it right, with the ClassConstructor():
blablaobject(stuff),
morestuff(otherstuff),
vicShoulder(6,10) <- These lines are where you should make sure to initialize the constructors, and they have to be in the order you specified them in the class template.
{
more stuff here…
}
RobotClass;
Victor vicShoulder;
RobotVoid;
vicshoulder(6,1);
WhileinOperatorControl{
.....
if(armstick2.getY()){
vicShoulder.set(armstick2.getY);
}
i believe that is what we have
could it be an older victor that we cant program anymore cause we got stuff from an older team and the victors look old but they turn on and the fan works its just that the light blinks orange
Well, the first part looks funky and strange to me, as its still a bit out of scope (referring to, we need the code around the lines too), but what really caught my eye was the last few. Your “if” code makes no sense; what it’s doing right now is getting the Y value off the joystick and checking whether its centered or not… that, and the Set command requires a capital S. Why not just remove the if statement altogether? It’s useless.
All Victor 884’s are the same; to my knowledge they haven’t changed since they came out.
At the top of your code you have
vicshoulder(6,1);
For one thing, the S isn’t capitalized again, and… you need to initialize the Victor object in the class initilization section above the braces.
I’ll put some of my similiar code here later.
Check that the PWM cable is inserted fully into the Victor, and all the pins are lining up perfectly straight into the connector. Sounds simple, but is often incredibly hard to do. The easy way to check is to pull the PWM cable out of the Victor, and if any, or all of your pins aren’t PERFECTLY STRAIGHT, then you likely inserted it wrong. Even the slightest bit of deflection means that you likely missed the connector inside the Victor.
Inserting your PWM cable into the Victor should take almost no downward force, if aligned perfectly. If you have to push a little too hard to get the connector in, you’ve plugged it in wrong.
Could it be that in my code i have an if statement that means this:
if the arm is triggering the front sensor the shoulder will not move unless you give a negative value. and if it is on the back sensor it will not move unless its on the front sensor.
But we do not have the senors hooked up yet, so could that be it?
For right now without the sensors on there cant i just do something like this to drive my shoulder joint?
If you’re trying to read data from sensors that aren’t hooked up and using that to determine whether or not to move, that could by your problem.
To run the Victor, you’ll want the first one you posted. I’m sure you had the wrong syntax because you were typing from memory, not because you don’t know it, but make sure it’s
vicShoulder.Set(stickName.GetY())
Not
vicShoulder.Set(stickName.GetY)
Note the parentheses. If you don’t have it, it should give a compiler error though, so probably not your problem.
I’m actually having some Victor troubles of my own right now, but I believe that should work - it’s not on mine though, so hopefully someone can come to help us both out. Try it if you can though, and let us know what happens
You may also want to try different victors; my team had an issue where we had one working victor out of five.
NOTE: If the victors are in fact the problem try to take them apart and clean out any debris. (This fixed them for me)