Arduino Uno example Blink 1 LED

preview_player
Показать описание
Require Components:
1x Arduino Uno
1x Resistor 220Ω
1x LED diameter = 5mm
2x Wires

Steps:
1. Use first Wire to connect pin 13 and Resistor 220Ω
2. Connect Resistor 220Ω and positive (+) leg (longer leg) of the LED
3. Use second Wire to connect negative (-) leg (smaller leg) of the LED to pin GND

Code:
int pinLED = 13;
void setup() {
pinMode(pinLED, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(pinLED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(pinLED, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Рекомендации по теме