티스토리 뷰
I tried to turn on 8 LEDs sequentially using the Arduino Digital Pin0 to Pin7.
To find out what pins do on the Arduion Uno board, I looked up the pinmap.
Reference : https://www.theengineeringprojects.com/2018/06/introduction-to-arduino-uno.html
Plug eight jumper wires into the Arduino Digital Pin0 to Pin7.
Other side of the jumper wires are plugged into the breadboard and connected with LEDs and 220 ohm resistors as shown.
The minus line (GND) where the ends of the resistors are plugged connects to the GND on Arduino board.
Run Arduino IDE and write a code as follows.
"pinMode" defines a specific pin as an output or an input.
Dgital Pin0 to Pin7 are defined as OUTPUT using for loop.
"digitalWrite" is a function that send 5 voltage (High) or 0 voltage (Low) through the specific pin.
"delay (1000)" can hold the status of the LEDs for 1 second (1000 ms).
Compile and upload the code into the Arduino.
However, error occurred while uploading the code and the file uploading failed.
After trial and error, I was able to upload the file by disconnecting jumper wire connected to Digitalpin0.
Digitalpin0 also can be a serial port RXD, which is probably related to this.
After upload the file, I could check the LEDs shift successfully.