際際滷

際際滷Share a Scribd company logo
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
 Lets 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
 Lets 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

More Related Content

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 the LED - Overview Lets 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 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. 4 Turn on the LED - Result Built-in LED is turned on! LED ON Source: pixabay.com/photo-2168193
  • 5. 5 Turn off the LED - Overview Lets turn off the LED Simple code Turn off the built-in LED Source: pixabay.com/photo-2168193
  • 6. 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. 7 Turn off the LED - Result Built-in LED is turned off! LED OFF Source: pixabay.com/photo-2168193