Arduino Programming: EAS 199A, Fall 2010, Lecture 5 Gerald Recktenwald Portland State University Gerry@me - Pdx.edu
Arduino Programming: EAS 199A, Fall 2010, Lecture 5 Gerald Recktenwald Portland State University Gerry@me - Pdx.edu
Part 1
EAS 199A, Fall 2010, Lecture 5
Gerald Recktenwald
Portland State University
gerry@me.pdx.edu
Overview
Write sketch on PC
Serial communication
back to host
IDE =
Integrated
Development Tab
controls
Environment
http://www.arduino.cc/en/Guide/Environment
Code pane
Message pane
Tab
controls
http://www.arduino.cc/en/Guide/Environment
Arduino Programming: EAS 199A 9
Arduino Web Site References
loop function is
repeated indefinitely
pinMode(13, Output)
prepare pin 13 for
outputs of voltage
digitalWrite(13, HIGH)
Sets pin 13 to voltage
that means “on”
delay(1000);
tells microcontroller to do
nothing for 1000 ms = 1 s
digitalWrite(13, LOW)
Sets pin 13 to voltage
that means “off”
int red_LED_pin = 5;
Defines the variable type as an integer
Uses the value stored in red_LED_pin