|
Page 1 of 1
|
[ 4 posts ] |
|
micro controller not accepting program
Author |
Message |
vexmche123
Rookie
Joined: Sun Jul 10, 2011 3:34 pm Posts: 30
|
 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; }
|
Sun Jul 10, 2011 3:37 pm |
|
 |
bfeher
Site Admin
Joined: Mon Jun 08, 2009 4:50 pm Posts: 70
|
 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.
_________________ Bence Feher
Undergraduate Intern - NREC, Robotics Academy ROBOTC - Testing/Documentation/Developer
Computer Science, Japanese, East Asian Studies University of Pittsburgh, Konan University 甲南大学
|
Tue Jul 12, 2011 11:02 am |
|
 |
vexmche123
Rookie
Joined: Sun Jul 10, 2011 3:34 pm Posts: 30
|
 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
|
Tue Jul 12, 2011 11:23 am |
|
 |
bfeher
Site Admin
Joined: Mon Jun 08, 2009 4:50 pm Posts: 70
|
 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.
_________________ Bence Feher
Undergraduate Intern - NREC, Robotics Academy ROBOTC - Testing/Documentation/Developer
Computer Science, Japanese, East Asian Studies University of Pittsburgh, Konan University 甲南大学
|
Thu Jul 14, 2011 5:21 pm |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|