FRC team 5584. Est. 2014

 

 

Follow Our Progress

Keep updated with the team by following our social media channels. For exciting highlights videos and robot reveals, be sure to subscribe to our YouTube channel!

Read more

 

Robocamps

Come and join us at one of our Robo Camp workshops! Held at three locations across the Eastern suburbs of Melbourne. Register on our website now!

Read more

 

Our Sponsors

The companies that support our team to run each season and are helping us promote a bright future for STEM in Australia. 

Read more

 

We also show how to confirm it is operating correctly by downloading a simple programcalled "blink" hat flashes the onloard LED on and off. Note that arduino programs are called "sketches". All Arduino hardware is programmable with open source software which is available for Linux and Windows PCs.

 

What do I need to complete this exercise?

  • 1 x Arduino Leonardo board
  • 1 x Plug pack 9v 1A DC with 2.1mm diameter center-positive jack
  • USB cable (Type-A to Micro-B)
  • a PC running Linux or Windows

 

How do I install and setup on Linux?

These instructions were tested on an HP Netbook running Ubuntu 14.04 with an Arduino Leonardo board:

  1. Update platform with "sudo apt-get update"
  2. Install IDE with "sudo apt-get install arduino arduino-core"
  3. Restart to enable groups on serial devices
  4. Login (any user)
  5. Search for "Arduino IDE" application and drag it onto the tool bar
  6. Click on the "Arduino IDE" application to launch it

 

How do I install and setup on Windows?

These instructions were tested with Microsoft Windows 7 with an Arduino Leonardo board (PCs that worked were a Lenovo "X201" and also the Classmate "2go PC"):

  1. Use your browser to navigate to https://www.arduino.cc
  2. Select "Download"
  3. If you do not have local administrator access to your PC then you should select "Windows ZIP file for non admin install", unzip to the local hard drive and then jump to step 10
  4. If you do have local administrator access to your PC then select "Windows Installer" then "Just Download" to download the latest version (e.g. arduino-1.6.6-windows.exe)
  5. Run the downloaded file and provide an administrator username and password if/when prompted for it
  6. Select "I agree" to acknowledge the license agreement
  7. Select "Next" then "Install" to install the default components to the default location.
  8. If prompted with "Would you like to install this device software?" then select "Install" (you may observe several of these prompts)
  9. Select "Close"
  10. Add the software to the windows task bar by dragging the "Arduino" shortcut from the start menu on to the task bar
  11. To launch Arduino software simply select the icon on the task bar
  12. If you are prompted with "Windows Firewall has blocked some features of this app" then select "Allow Access"

 

How do I download a program to the Arduino?

  1. Plug USB cable into Arduino and USB port on PC
  2. Plug PSU into Arduino if you have it (this is not always necessary for the blinky project that we use here but will be for projects that have a higher power requirement, if you have one then use it as this is the most common cause for communications and loss of reliability, unpredictable outcomes etc ...)
  3. Check connection between PC and Arduino (this may not be present - see note below)
    • If your PC is running Windows: you will need to wait for the drivers to complete their installation (this will occur automatically) then under "Tools" > "Port" and check that "COMx (Arduino Leonardo)" is present
    • If your PC is running Linux: select "Tools" > "Serial Port" and check that "/dev/ttyACMx" is present
  4. Select "Tools" > "Board" and check that "Arduino Leonardo" is selected
  5. Select "Tools" > "Programmer" and check that "AVRISP mkII" is selected
  6. Select "File" > "Preferences" and make sure everything is ticked except for the "external editor" option
  7. Write or copy+paste the sample blink code into the main window of the Arduino IDE (see next section describes where to find this program)
  8. Save the sketch using the Save" icon or via the menu ("File" > "Save")  or using the keyboard shortcut (CTRL+S)
  9. You can now load the program onto the Arduino by selecting the "Upload" icon or via the menu("File" > "Upload") or using the keyboard shortcut (CTRL+U)
  10. When it completes you should see "Upload Done" in the status bar and "avtdude done. Thank You." should be reported in the bottom pane of the IDE
  11. Sometimes the upload will stall and eventually time out, if this is the case then one of the problem will be repeatedly displaying in the bottom pane of the IDE ...
    • "PORTS {} / {} => {}"
    • "PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, } => {}"
    • "PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}"
  12. If this occurs then press then restart the upload and press the reset button on the Arduino to force a software reset and re-establish the USB connection
  13. If this also fails then restart the upload again and remove the Arduino power cable and re-plug while the upload is still in progress, this should force the board to reset.

NOTE: the Leonardo Arduino shares the same chip for running programs and managing the USB connection. This does mean the connection will go bad at times and you appear to be unable to upload new programs. The primary symptom is the "Serial Port" (under Tools" menu) being greyed out. The solution that seems to work is as follows: (a) prepare your sketch; (b) save with CTRL+S; (c) upload with CTRL+U; (d) while the upload is in progress unplug the power cord from the Arduino board and immediately reinsert power cord. This method seems to work in cases where the on-board rest button does not have any effect.

NOTE: other commands that may be useful in diagnosing serial port problems: "averdude -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600" and "while true; do ls -al /dev/ttyA*; done"

Where is the code for the blink sketch?

It is available as example code when you install the IDE as described above. It is available under "File" > "Examples" > "01. Basics" > "Blink" . It is also copied here:

int led = 13;
void setup() {                
  pinMode(led, OUTPUT);     
}
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on
// (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making
// the voltage LOW
delay(1000); // wait for a second }