Problems downloading to EDM micro-controller

So for a while now our class has been trying and failing to download code to our microcontrollers. Even the sample code won’t work. When we download the code to our robot, it just turns all the motors on to full power regardless of what the code says. We’ve updated our firmware, and according to windows, our controller is connected properly via USB. This happens on every computer, with all of our micro-controllers, with every single code we’ve tried. Please help.

Hi Noah, can you post your code for us to look at?

1 Like

Sure. This is the code we’ve been testing all of our microcontrollers with. (We’re using the PLTW Natural Language if that helps)

#pragma config(Motor, port1, leftMotor, tmotorVex269_HBridge, openLoop)
#pragma config(Motor, port2, rightMotor, tmotorVex269_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

task main()
{
motor[leftMotor] = 100;
motor[rightMotor] = 100;
wait(10);
}

On our actual code, the indents are all there, but when put into a blockquote it gets rid of them.

OK, so I’d expect the download to happen and the motors to start and keep on going. You might want this

task main()
{
motor[leftMotor] = 100; // move forward
motor[rightMotor] = 100;
wait(10);
motor[leftMotor] = 0;  // now stop
motor[rightMotor] = 0;
}
3 Likes

Thank you! I’ll test it out.

Just a note, on one of your motors, you’ll need to toggle the “reverse” flag so it will drive straight. As it is now, the robot will drive in a circle.

1 Like