Review:
What is LED?
A light-emitting diode is a two-lead semiconductor light source. It is a p-n junction diode that emits light when activated.
Negative polarity or Cathode “-“ is the shortest pin. (see also the LED bulb with flat side)
Positive polarity or Anode “+” is the longest pin.
What is a Resistor?
A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. The resistor’s resistance limits the flow of electrons through a circuit. They passive components, meaning they only consume power.
Reference: Wikipedia,LED,Resistor
Materials Need:
1 x gizDuino PLUS ATmega644P
1 x Solderless Breadboard
1 x Red LED 5mm
1 x 560 Ohms
1 x USB Cable
2 x 1pin Jumper wire (male-male)
Schematic Diagram:
Wiring Connection:
Digital pin 13 —> (+) Anode LED
(-) Cathode —> 560 Ohms —> Ground
Code:
| /* |
| |
| "GizDuino Starter kit" |
| |
| BLINK Sample code |
| |
| STEP 1: Construct the circuit of GizDuino Blink. |
| STEP 2: Connect the USB Cable to your computer. |
| STEP 3: Open the Arduino IDE. |
| STEP 4: Open the BLINK Sample code from GizDuino Starter kit code. |
| STEP 5: Then, click Upload. |
| |
| This sample code is based on Arduino Example>Basic>Blink. |
| |
| It is a simple program turns on the LED in 1 second and turn off in 1 second. |
| |
| This example code is in the public domain. |
| */ |
| |
| |
| // led is the givenname for digital pin 13. |
| int led = 13; |
| |
| // the setting up of pins. |
| void setup() { |
| // initialize the digital pin as an output. |
| pinMode(led, OUTPUT); |
| } |
| |
| // the loop is where your program runs repeatedly. |
| void loop() { |
| digitalWrite(led, HIGH); // turn the LED ON (HIGH) |
| delay(1000); // wait for a second |
| digitalWrite(led, LOW); // turn the LED OFF (LOW) |
| delay(1000); // wait for a second |
| } |
Leave a Comment