Pro Yearly is on sale from $80 to $50! »

Arduino: Why, Which, and How

287abe4d8c0bf8eae92dd59b753f6323?s=47 Theo Pak
September 24, 2014

Arduino: Why, Which, and How

Intro to Arduino
============

Presented by request for MANE-4220 "Inventor's Studio" (Prof. Swersey) with the support of RPI Embedded Hardware Club.

"What's an Arduino?"

1. Why use an Arduino?
2. Which type of Arduino?
3. How?

Join the Embedded Hardware Club mailing list to get info about upcoming workshops and events. Check us out at http://facebook.com/rpiEHC and http://rpiEHC.org.

- Theo Pak
- theopak@gmail.com
- facebook.com/rpiEHC

287abe4d8c0bf8eae92dd59b753f6323?s=128

Theo Pak

September 24, 2014
Tweet

Transcript

  1. INTRO TO ARDUINO @theopak Sept 24, 2014

  2. WHAT’S AN ARDUINO?

  3. None
  4. ARDUINO • Microcontroller platform • Open source • You can

    make cool stuff with it • You program it with the Arduino language 
 using the Arduino software (Mac, PC, or linux)
  5. 1. Why use an Arduino? 2. Which type of Arduino?

    3. How?
  6. 1. Why use an Arduino? 2. Which type of Arduino?

    3. How?
  7. CASE STUDY: HACKATHON WINNERS • Silicon Chef (Nov 2012) •

    4 people • 6 hours • Engineering professors hated it • Engineering professors awarded first place
  8. None
  9. None
  10. None
  11. None
  12. WHY USE AN ARDUINO? • Easier to learn than alternatives.

    • Widely available for cheap! • Tons of code already exists. • Generally appropriate for real-time. • Not always the best choice, especially because: • Other options have better specs. • Other options use lower power.
  13. None
  14. 1. Why use an Arduino? 2. Which type of Arduino?

    3. How?
  15. TYPES OF ARDUINOS Nano >$14 ATmega328p small, cheap, breadboardable Leonardo

    $20 ATmega32u4 cheap, more GPIO Y dual p Linux
  16. TYPES OF ARDUINOS Due $50 32-bit ARM tons of GPIO

    Yún $70 dual processors Linux, WiFi, etc. $20 2u4 GPIO
  17. 1. Why use an Arduino? 2. Which type of Arduino?

    3. How?
  18. Install the Arduino IDE via arduino.cc/en/Main/Software

  19. EXAMPLE CIRCUIT: DIGITAL OUTPUT Switch on D5, LED on D13

  20. EXAMPLE CODE: FLASH AN LED void setup () { pinMode(13,OUTPUT);

    } void loop () { // Turn LED on digitalWrite(13,HIGH); delay(100); // Wait 100 milliseconds // Turn LED off digitalWrite(13,LOW); delay(100); // Wait 100 milliseconds }
  21. EXAMPLE CODE: BUTTON INPUT void setup () { pinMode(13,OUTPUT); //

    Configure Pin13 as output pinMode(5,INPUT); // Configure Pin5 as input } void loop () { // If the button is pressed... if (digitalRead(5)) { // ...then turn LED on digitalWrite(13,HIGH); } else { // ...if not, the turn LED off digitalWrite(13,LOW); } }
  22. EXAMPLE CODE: SERVO MOTOR #include <Servo.h> Servo myservo; //create servo

    object to control a servo motor void setup () { myservo.attach(9); //attach pin 9 to the servo object } void loop () { for (int i = 0; i < 255; i ++) { // set the servo position myservo.write(i); // generate PPM signal // wait for the servo to get there delay(15); } }
  23. THEO PAK theopak@gmail.com Sage 2202 Wednesdays 6–8pm

  24. Embedded Hardware Club facebook.com/rpiEHC