KEMBAR78
Arduino tutorial #1 | PPTX
1
Dong Ho Son
POSTECH
Pohang, Korea
donghoson@postech.ac.kr
Arduino Tutorial #1
- Turn on/off the LED -
2
Turn on the LED - Overview
 Let’s turn on the LED
• Simple code
• Turn on the built-in LED
− Built-in LED for test
− Internally connected to digital pin #13
Source: pixabay.com/photo-2168193
3
Turn on the LED - Sketch
 setup() { }
• pinMode(13, OUTPUT);
− Prepare the mode of pin
− We will use pin #13
− We will order to LED  OUTPUT
 loop() { }
• digitalWrite(13, HIGH);
• Write digital value to the board
− We will use pin #13
− Turn on == HIGH
4
Turn on the LED - Result
 Built-in LED is turned on!
LED ON
Source: pixabay.com/photo-2168193
5
Turn off the LED - Overview
 Let’s turn off the LED
• Simple code
• Turn off the built-in LED
Source: pixabay.com/photo-2168193
6
Turn off the LED - Sketch
 setup() { }
• pinMode(13, OUTPUT);
− Prepare the mode of pin
− We will use pin #13
− We will order to LED  OUTPUT
 loop() { }
• digitalWrite(13, LOW);
• Write digital value to the board
− We will use pin #13
− Turn off == LOW
7
Turn off the LED - Result
 Built-in LED is turned off!
LED OFF
Source: pixabay.com/photo-2168193

Arduino tutorial #1

  • 1.
    1 Dong Ho Son POSTECH Pohang,Korea donghoson@postech.ac.kr Arduino Tutorial #1 - Turn on/off the LED -
  • 2.
    2 Turn on theLED - Overview  Let’s turn on the LED • Simple code • Turn on the built-in LED − Built-in LED for test − Internally connected to digital pin #13 Source: pixabay.com/photo-2168193
  • 3.
    3 Turn on theLED - Sketch  setup() { } • pinMode(13, OUTPUT); − Prepare the mode of pin − We will use pin #13 − We will order to LED  OUTPUT  loop() { } • digitalWrite(13, HIGH); • Write digital value to the board − We will use pin #13 − Turn on == HIGH
  • 4.
    4 Turn on theLED - Result  Built-in LED is turned on! LED ON Source: pixabay.com/photo-2168193
  • 5.
    5 Turn off theLED - Overview  Let’s turn off the LED • Simple code • Turn off the built-in LED Source: pixabay.com/photo-2168193
  • 6.
    6 Turn off theLED - Sketch  setup() { } • pinMode(13, OUTPUT); − Prepare the mode of pin − We will use pin #13 − We will order to LED  OUTPUT  loop() { } • digitalWrite(13, LOW); • Write digital value to the board − We will use pin #13 − Turn off == LOW
  • 7.
    7 Turn off theLED - Result  Built-in LED is turned off! LED OFF Source: pixabay.com/photo-2168193