Skip to content

Commit 82ed571

Browse files
Set LEDs in correct order
1 parent 22d3d18 commit 82ed571

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Binary_clock.ino

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
#include <DS1307RTC.h>
44
#include <Wire.h>
55

6-
const int hourPins[] = {2, 3, 4, 5, 6};
7-
const int minutePins[] = {7, 8, 9, 14, 15, 16};
8-
const int secondRed = 10;
9-
const int secondGreen = 11;
10-
const int secondBlue = 12;
6+
const int hourPins[] = {6, 5, 4, 3, 2};
7+
const int minutePins[] = {A1, A0, 13, 12, 8, 7};
8+
const int secondRed = 9;
9+
const int secondGreen = 10;
10+
const int secondBlue = 11;
1111
const bool blinkSecondPins = true;
1212
int amountOfMinutePins = 6;
1313
int amountOfHourPins = 5;
@@ -21,10 +21,10 @@ void setup() {
2121
setSyncInterval(100);
2222

2323
int i;
24-
for (i = 0; i < amountOfHourPins ; i++){
24+
for (i = 0; i < amountOfHourPins; i++){
2525
initOutputPin(hourPins[i]);
2626
}
27-
for (i = 0; i < amountOfMinutePins ; i++){
27+
for (i = 0; i < amountOfMinutePins; i++){
2828
initOutputPin(minutePins[i]);
2929
}
3030
pinMode(secondRed, OUTPUT);
@@ -102,6 +102,7 @@ void updateSecondColor(int seconds){
102102
int blue = 0;
103103
if (seconds <= 21){
104104
blue = seconds*2;
105+
green = 21 - seconds;
105106
} else if (seconds <= 41){
106107
red = seconds;
107108
blue = 41 - seconds;

0 commit comments

Comments
 (0)