Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Arduino 101

Arduino 101

Slides to support a 1.5 hour class on the Arduino open source hardware platform.

Daniel Packard

January 23, 2014
Tweet

More Decks by Daniel Packard

Other Decks in How-to & DIY

Transcript

  1. Arduino 101 Presented by Daniel Packard ­ 2013/12/14 With Maurice

    Woods III, Casey Kuhns, and Stephen Warren
  2. Arduino (Redboard) is... A programmable micro­controller. Atmega Processor IO pins

    USB Serial Interface (and power) Power A programmable micro­controller. But the best way to explain the Arduino is with some examples: http://www.instructables.com/id/20­Unbelievable­Arduino­Projects/ https://www.youtube.com/watch?v=6mXM­oGggrM http://www.youtube.com/watch?v=yuKcLG1tqks
  3. Programmable Circuits Build a simple circuit (electronics) Write a control

    program (software) Image attributed to SparkFun Electronics
  4. Arduino 101 Installation: Windows and Mac users: Download the installer

    from: • http://arduino.cc Linux users(specifically Debian): In a terminal: • sudo apt-get install arduino • sudo usermod -aG dialout <user> • Logout, and log back in for changes to take effect.
  5. Building the Circuit Inside your kit, you'll find: 2 Jumper

    cables 1 LED 1 resistor 1 RedBoard 1 Breadboard
  6. Getting ready to program the Circuit First, we need to

    connect to a pin we can control (instead of the 5V power pin) ­ + Short Leg 9
  7. Programming Primer // single­line comments look like this. /* Multi­line

    comments look like this */ // variable declarations look like this int variable_name; boolean isOn; // function declarations look like this void func_name(args...) { // function body } // statements looks like this do_something(); led_state = readDigital(9);
  8. Anatomy of an Arduino Sketch // Global constants and state

    data const int LED = 9; // setup function that is called once at power on void setup() { pinMode(LED, OUTPUT); } // loop function gets called in a loop void loop() { // do exciting stuff! DigitalWrite(LED, HIGH); Delay(500); DigitalWrite(LED, LOW); Delay(500); }
  9. Anatomy of an Arduino Sketch // Global constants and state

    data const int LED_PIN = 9; // setup function that is called once at power on void setup() { pinMode(LED_PIN, OUTPUT); } // loop function gets called in a loop void loop() { // do exciting stuff! DigitalWrite(LED_PIN, HIGH); Delay(500); DigitalWrite(LED_PIN, LOW); Delay(500); } Global Data One­time Setup Loop
  10. Where to go from here Arduino 102 ­ building interactive

    circuits Arduino 201 ­ writing a serial protocol Arduino 301 ­ build an Arduino shield
  11. Thank you for coming! Did you enjoy today's class??? Help

    fund future LCS events! “pay what you think it's worth”