Arduino Workshop - University of Sydneyrp- · A quick intro – For loops & Serial void setup()...
Transcript of Arduino Workshop - University of Sydneyrp- · A quick intro – For loops & Serial void setup()...
ARDUINO WORKSHOPCS4HS, 2016
The University of Sydney
What is an Arduino?
2
Features• 5V Operating Voltage• 14 Digital I/O pins • 6 Analogue inputs• 6 PWM pins• USB serial• 16MHz Clock speed• 32KB Flash memory• 2KB SRAM• 1KB EEPROM• Weight 25g
Some cool projects
3
Scooterputer
http://www.janspace.com/b2evolution/blogs/media/Arduino/VisualSchematic.png | http://blog.bricogeek.com/img_cms/1598-scooterputer-arduino.jpg
Some cool projects
4
3D printers
https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/RepRap_v2_Mendel.jpg/800px-RepRap_v2_Mendel.jpg
Some cool projects
5http://droneselect.com/wp-content/uploads/2014/08/Intro.jpg | http://www.ardupilot.co.uk/uploads/6/7/0/2/6702064/1818461_orig.jpg
Unmanned Aerial Vehicles
3DR X8 OctacopterArdupilot Autopilot
Arduino IDE
6
Verify- Compile the code
Upload- Upload to the Arduino
Code- Write your program
Serial- Text interface to Arduino
Info Panel- Diagnostic information
Before we begin
7
- Select your board
- Select your port
Breadboards
8
Top view Wire view
Images from Sebastian Goscik
Structure of an Arduino program (aka “sketch”)
9
void setup() {// put your setup code here, to run once:
}
void loop() {// put your main code here, to run repeatedly:
}
A quick intro – For loops & Serial
void setup()
{
Serial.begin(9600); // Setup serial
}
void loop() {
for (int counter = 0; counter < 10; counter += 1)
{
Serial.println(counter); // Print the value of the counter
delay(500); // Delay half a second (500 milliseconds)
}
}
10
A quick intro – Adding If conditions
void loop() {
for (int counter = 0; counter < 10; counter += 1)
{
Serial.println(counter); // Print the value of the counter
delay(500); // Delay half a second (500 milliseconds)
if (counter == 9)
{
Serial.println("Hello!");
delay(500);
}
}
}
11
ArduBlock
12
A graphical programming language for Arduino
http://blog.ardublock.com/
Useful resources
13
Arduino Workshop by John Boxall
www.hackaday.comwww.instructables.com
http://playground.arduino.cc/https://blog.arduino.cc/
www.tronixstuff.com
http://makezine.com/blog/
https://blog.adafruit.com/