LED_Lesson - jimaobian/DFRobotWiki GitHub Wiki

Introduction

Starting from a simple LED, this lesson gives the very basic introduction about Arduino.

JJWfYfD_-Ww Part List ---------
  • DFRduio Duemilanove or Compatible Arduino Controller (1 unit)
  • Green/Red/Yellow LED (1 unit)
  • Resistor-220 ohm (1 unit)
  • Prototyping Shield (1 unit)
  • Mini Breadboard (1 unit)
  • Jumper Cables (2 units)

Connection Diagram

Connection Diagram

Sample Code

//For Arduino Start kit
//Compatible with all Arduino version
//Last updated 2010-12-1
//www.dfrobot.com

int ledPin=8; //Connect led to Digital Pin 8
void setup()
{
    pinMode(ledPin,OUTPUT);//Set ledPin as output
}
void loop()
{
    digitalWrite(ledPin,HIGH); //Pull ledPin to high
    delay(1000); //Delay 1 second
    digitalWrite(ledPin,LOW); //Pull ledPin to low
    delay(1000); //Delay 1 second
}
⚠️ **GitHub.com Fallback** ⚠️