MIT-DTFA 세경 Workshop

January 2017

View project on GitHub

Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. Arduino is a small circuit board with an Atmel MicroController chip and other parts.

Arduino is a “Rapid Electronics Prototyping Platform” which consists of two main parts:

HARDWARE: An Arduino Open-Source Microcomputer board

SOFTWARE: The free Arduino IDE that runs on PC, MAC, or Linux

ARDUINO BASIC OVERVIEW

STRUCTURE OF ARDUINO SOFTWARE:

Every Arduino Software Sketch has two main parts:

SETUP - Runs Once at the beginning

LOOP - Runs over and over again, forever

The Simplest Arduino Code - LED Blink

Arduino makes it very easy to use commands! Here is a simple code to get started:

#define led 13  // define name of pin number 

void setup()   /****** SETUP: RUNS ONCE ******/
{
  pinMode(led, OUTPUT);  // initialize the digital pin as an output. 
}

void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second, watching the bright LED
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second, watch the Dark
}

What SETUP does: Tells Arduino about things that need to be done once. Arduino Digital Pins can be either INPUT or OUTPUT. You have to tell Arduino when a Pin will be used as an OUTPUT. In this example, there is one line that tells Arduino that Pin 13 must be an OUTPUT.