1

Upload Code

Ready to upload a simple program? Copy this code into a new Arduino sketch and upload it to your remote control.

void setup() {

  pinMode(11, OUTPUT);
  pinMode(18, OUTPUT);

}
void loop() {

 digitalWrite(11, HIGH); 
 digitalWrite(18, LOW);
 delay(500); 
 digitalWrite(11, LOW);
 digitalWrite(18, HIGH);
 delay(500);
}

Sometimes it is helpful to write out your code in words that you understand before actually programming. This is known as pseudocode.

This is the pseudocode for the above program:

  • Set up pins 11 and 18 on your Smart Inventor Board as outputs.
  • Turn on the LED connected to pin 11 for 500 milliseconds.
  • Turn off the LED connected to pin 18 for 500 milliseconds.
  • Turn off the LED connected to pin 11 for 500 milliseconds.
  • Turn on the LED connected to pin 18 for 500 milliseconds.

If your code successfully compiles but won’t upload, there could be a few reasons:

  • Make sure your controller is in upload mode. To review how to get into upload mode, go here.
  • Try a different cable! The upload cable is a standard USB to micro USB cable.
  • Remember to pick the right COM port in Arduino!
  • Unplug and replug the USB cable and try again.

The Smart Inventor Board doesn’t go into upload mode!

  • If the Smart Inventor Board is in upload configuration (DIP switch 1 is up, DIP switches 2 and 3 are down) but not in upload mode, try hitting the reset button under the DIP switches until it goes into upload mode.

The Bluetooth board doesn’t go into upload mode!

  • If the Bluetooth board does not enter upload mode, restart the remote control by turning it off and then turning it back on. From there, click the small black button located by the LED light on the Bluetooth board to put it back into upload mode, which should be a blinking red.

My remote control can’t go into upload mode and the LED lights turn on when the IR sensors are covered!

  • This means your board was accidentally factory reset. Due to the hardware and software requirements, the original firmware can only be uploaded onsite at Robolink. Contact info@robolink.com for details on replacing your board.

If everything worked, the bar at the bottom of Arduino above the dark console window should say “Done uploading.” and your program should have uploaded successfully.

Switch the remote into run mode by putting DIP switch 1 back down (and make sure the other 2 are also down), then you’ll see two lights on the Smart Inventor board blinking back and forth.

If you see that happening, your very first program has successfully uploaded! Now let’s move on to write some code that actually pairs with the CoDrone.