Skip to content

Code Upload

Rick edited this page Oct 12, 2019 · 4 revisions

Uploading your code

  1. Download and install the Arduino IDE. Make sure you get the correct one for your OS!
  2. Download code from here. Click Source Code (zip) to get the repository. Additionally, download whichever .zip file corresponds with your OS. You will need to extract the Sumo-Competition-1.2.zip file once you have it on your computer. You can place Sumo-Competition-1.2 and <your OS>.zip wherever you like.
  3. Open the Arduino IDE, and click on Sketch -> Include Library -> Add .ZIP Library and add the SparkFun_TB6612FNG_Arduino_Library-master.zip from the Sumo-Competition-1.2 folder. This is required for the sumo.ino file to compile successfully.
  4. Open the code for your robot: a file called sumo.ino inside a folder sumo. Do not rename either of these, but you may edit the contents of sumo.ino if you would like to change how your robot responds.
  5. Connect your computer to the Arduino board. Click on Tools -> Board: ... and select "Arduino Nano" from the list. Now click the right-facing arrow button in the upper left corner of the Arduino IDE to compile and upload your code.
    • NOTE: You might encounter problems here (Arduino Nanos are notoriously glitchy for code upload). Call over a GW Robotics team member for assistance, or try Googling the error message to debug it yourself!

NOTE: You will now need the wiring to be complete

  1. Connect to "HC-06" (or possibly "Unknown Device") on your laptop's bluetooth. Use the PIN code "1234".
  2. Open up <your OS>.zip and run the executable inside. You may need to disable your antivirus because it won't recognize the file. The program will scan your system for available serial ports and then ask you to select one. You may have to try multiple ports to find which one corresponds with the HC-06 bluetooth module.
  3. Once connected, use the arrow keys on your laptop to control the robot.
Clone this wiki locally