Download presentation
Presentation is loading. Please wait.
1
Get Your Project Started with Arduino
Class 2: Getting Started with Arduino June 10, 2014 Don Wilcher
2
Getting Started with Arduino
Topics Arduino IDE What is a Sketch? Let’s Blink an LED! Make: Basic Arduino Projects Let’s Make a Trick Switch!
3
Arduino IDE What is the Arduino IDE (Integrated Development Environment)? It’s an Open Source software platform for developing Arduino applications. It has a simple text editor for typing in code for the Arduino application. It allows the code to be uploaded to the Arduino. It has a Serial Monitor for debug of code and displaying text messages on notebook and desktop computers screen or monitor.
4
Arduino IDE…
5
Arduino Serial Monitor
6
What is a Sketch? “Arduino team calls the embedded software of its computing platform a sketch because the device was created for artists interested in making their artwork or pieces interactive with the viewer or audience.”[1] A little computer program Software code to tell the Arduino what to A variant C programming language
7
What is a Sketch?... Reference: [1] Learn Electronics with Arduino, Wilcher, D., Apress, 2012
8
Let’s Blink an LED!
9
Blink Sketch /* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: 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
10
Make: Basic Arduino Projects book
11
Let’s Make a Trick Switch
12
Let’s Make a Trick Switch: Fritzing Wiring Diagram
13
Let’s Make a Trick Switch: Circuit Schematic Diagram
14
Let’s Make A Trick Switch: The Sketch
// constants won't change; they're used here to // set pin numbers: const int buttonPin = 2; // the number of the pushbutton pin const int ledPin = 12; // the number of the LED pin const int ledPin13 = 13; // onboard LED void setup() { // initialize the LED pins as outputs: pinMode(ledPin, OUTPUT); pinMode(ledPin13, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); } void loop(){ // read the state of the pushbutton value: int buttonStatus; buttonStatus = digitalRead(buttonPin); // check if the pushbutton is pressed // if it is, the buttonStatus is HIGH: if (buttonStatus == HIGH) { // turn LED on: digitalWrite(ledPin, HIGH); // turn off onboard LED: digitalWrite(ledPin13,LOW); else { // turn LED off: digitalWrite(ledPin, LOW); // turn on onboard LED: digitalWrite(ledPin13, HIGH);
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.