ROBOTC.net forums
http://www.robotc.net/forums/

micro controller not accepting program
http://www.robotc.net/forums/viewtopic.php?f=11&t=3364
Page 1 of 1

Author:  vexmche123 [ Sun Jul 10, 2011 3:37 pm ]
Post subject:  micro controller not accepting program

Hello,
I am a high school student and new to programming and robotics. I have a vex PIC robot with ROBOTC software. My first program seems to work when the PC is connected to the controller. I can use the debugger to “step” line by line through the program. In other words, I can control the robot from my computer using the debugger window (step button) but it will not run when we unplug the cable. It does not seem to keep the program in the controller. It seems like it does not accept the “downloaded” program.

When unplugged from the computer the motors spin in pulses. Here is the program below. The robot’s front motors are set up different from the back ones hence the negatives.

Is there any way to confirm the program has transferred to the VEX controller?

Is there a way to completely clear the memory on the controller?

Does downloading completely write over (clear out) all previous code?

Any help would be appreciated.

#pragma config(Motor, port1, RF, tmotorNormal, openLoop)
#pragma config(Motor, port2, RR, tmotorNormal, openLoop)
#pragma config(Motor, port3, LR, tmotorNormal, openLoop)
#pragma config(Motor, port4, LF, tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{
motor[port1] = 0; //stops
motor[port2] = 0;
motor[port3] = 0;
motor[port4] = 0;

wait1Msec(2000);

motor[port1] = -63; //run at half power
motor[port2] = -63;
motor[port3] = 63;
motor[port4] = 63;
wait1Msec(2000);

motor[port1] = 0; //stops
motor[port2] = 0;
motor[port3] = 0;
motor[port4] = 0;
}

Author:  bfeher [ Tue Jul 12, 2011 11:02 am ]
Post subject:  Re: micro controller not accepting program

Hi vexmche123,

If you are successfully downloading (no error windows popped up) then the code is certainly on the robot. However it wouldn't hurt to make sure that you have the latest firmware by choosing the Robot menu, and then Download Firmware. Choose the default. Downloading firmware will wipe all the rest of the programs from your robot.

Your code doesn't seem to be the cause of any spinning (as long as your motors are physically flipped like you said).

Try it and see if it helps.

Author:  vexmche123 [ Tue Jul 12, 2011 11:23 am ]
Post subject:  Re: micro controller not accepting program

Thank you so much I did this so many times before and it never worked but I did just like you said and i put my program in and it worked. I also changed the batteries do you think that that could of been part of the problem. Also one last question what is the button on the orange cable do? Thanks again for all your help

Author:  bfeher [ Thu Jul 14, 2011 5:21 pm ]
Post subject:  Re: micro controller not accepting program

Glad to hear that you got it working! The orange button stops the program from running. You may need to reboot the robot after pressing the orange button for your computer to recognize it. That might have been your issue.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/