diff --git a/multible_led/platformio.ini b/multible_led/platformio.ini index ea23b77..f015c4a 100644 --- a/multible_led/platformio.ini +++ b/multible_led/platformio.ini @@ -12,3 +12,4 @@ platform = atmelavr board = uno framework = arduino +monitor_speed = 115200 diff --git a/multible_led/src/main.cpp b/multible_led/src/main.cpp index cb9fbba..830d17c 100644 --- a/multible_led/src/main.cpp +++ b/multible_led/src/main.cpp @@ -1,18 +1,32 @@ #include -// put function declarations here: -int myFunction(int, int); +int ledsCount = 4; +int ledPins[] = {12,11,10,9}; + void setup() { // put your setup code here, to run once: - int result = myFunction(2, 3); + Serial.begin(115200); + Serial.println("Start Multiple Led"); + for (int i = 0; i < ledsCount; i++) + { + pinMode(ledPins[i], OUTPUT); + } + } void loop() { // put your main code here, to run repeatedly: + for (int i = 0; i < ledsCount; i++) + { + digitalWrite(ledPins[i], HIGH); + delay(50); + digitalWrite(ledPins[i], LOW); + } + for (int i = ledsCount -1; i >= 0; i--) + { + digitalWrite(ledPins[i], HIGH); + delay(50); + digitalWrite(ledPins[i], LOW); + } } - -// put function definitions here: -int myFunction(int x, int y) { - return x + y; -} \ No newline at end of file