arduino(22)
-
Day1 04_LED_mission
2번(빨강), 3번(노랑), 4번(연두)를 2초마다 차례대로 불을 키는 코드 const int ledRPin = 2; const int ledYPin = 3; const int ledGPin = 4; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(ledRPin, OUTPUT); pinMode(ledYPin, OUTPUT); pinMode(ledGPin, OUTPUT); } // the loop function runs over and over again forever void loop() {..
2024.01.17 -
Day 1 03 - for LED
const int ledPin = 13; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(ledPin, OUTPUT); } // the loop function runs over and over again forever void loop() { for (int t = 0; t
2024.01.15 -
Day 1 02 - serial
// the setup function runs once when you press reset or power the board void setup() { Serial.begin(9600); Serial.println(78, DEC); Serial.println(78, HEX); Serial.println(78, BIN); Serial.println(1.23456, 0); Serial.println(1.23456, 2); Serial.println(1.23456, 4); // pinMode(LED_BUILTIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, HIG..
2024.01.15 -
Day 1 01 - LED
const int ledPin = 13; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(ledPin, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) delay(9); // wait for a second digitalWrite(ledPin, LOW); // turn ..
2024.01.15