1 / 8

Arduino Part 2

Arduino Part 2. Topics: Programming Constructs: loops & conditionals Digital Input. Trying Something New. Scratch  is a project of the Lifelong Kindergarten Group at the  MIT Media Lab. S4A is a  Scratch  modification that allows for simple programming of the  Arduino.

kamana
Download Presentation

Arduino Part 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Arduino Part 2 Topics: Programming Constructs: loops & conditionals Digital Input

  2. Trying Something New • Scratch is a project of the Lifelong Kindergarten Group at the MITMedia Lab. • S4A is a Scratch modification that allows for simple programming of the Arduino

  3. Installing and Running S4A (S4A is already installed on the lab computers but you must still install the firmware.) • Download The S4A firmware from here • Connect your Arduino board to a USB port in your computer • Open the Arduino IDE • Open the firmware file (S4AFirmware15.ino) in the Arduino IDE • In the Tools menu, select the board version and the serial port • Load the firmware into your board using Tools > Upload • Open the S4A program

  4. Try It out

  5. Conditional Statement if (someCondition) {   // do stuff if the condition is true} else {   // do stuff if the condition is false} modelect.wordpress.com

  6. while Loop while(expression){ statement(s); } Example int var = 0;while (var < 200) {  // do 200 times  var = var + 1;} www.toves.org

  7. for loop www.visualcplusdotnet.com martin-thoma.com

  8. Digital Input (introducing the switch) Create the circuit above and then run File -> Examples -> Digital -> Button push-button switch www.ladyada.net/

More Related