Is it compiling correctly? Before you start yelling, let me explain… We were programming along over the weekend when things started going crazy on our robot. It took about 30 minutes before I realized that I was getting a compile error, but it was still building the .hex file for me to download even though it should abort. Double check for any error messages when you do your ‘Make All’ just in case.
Other than that, desk check your code and make sure you are actually getting to the the lines you are trying to run. Trust me, I’ve added the greatest routines ever written to some of my software over the years, only to have them not execute because I put them in the wrong place in my code. It’s quite embarrassing when your boss is expecting to see a simulated missile attack show up on the screen and nothing happens!
jdhawg is right on. If the program is not actually building correctly (you don’t see the error messages) and you load, the IFI loader will download the last .hex file that was created…leading you to believe that your new code simply is not working. This has happened to us before.
Try a different port to verify port 1 does not have a problem.
Let us know what you have learned.
Regards,
ChuckB
I have tried different ports, buttons, joysticks… it still doesnt work. I do agree I did not check to see if it builds correctly, but how do I tell? Here is the last output summary when I was building:
That should work. Make sure nothing else is controlling pwm01 later, and that your motor is actually connected to a Victor on pwm01. If the Victor’s light is flashing, there’s a problem with the pwm cable. You can plug a servo directly onto the pwm pins to make sure the signal is getting out of the RC. Also, use the Dashboard program to make sure the top joystick button is being recognized by the OI.
//Somewhere in the top of the file
int output =0;
//Down in the file
output = p1_sw_top;
if (output = 1)
{
pwm01=200;
}
This will not work the way you intend, because you used a single equals sign in your if statement. That sets output to 1 every time, pwm01 will always be set to 200.
what i mean is, RIGHT after the button code, you make it go foward anyway.
this way, if there’s anything that would change pwm01’s values, you will know, because the robot will still not move. if it does move, well then move on to another solution.