Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Shelf_Edge_Clock_V1/Shelf_Edge_Clock_V1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ DateTime MyDateAndTime;
// Which pin on the Arduino is connected to the NeoPixels?
#define LEDCLOCK_PIN 6
#define LEDDOWNLIGHT_PIN 5
#define LED_PER_SEG 7 // define no of leds per segment here no further changes required

// How many NeoPixels are attached to the Arduino?
#define LEDCLOCK_COUNT 216
#define LEDCLOCK_COUNT (23*LED_PER_SEG)
#define LEDDOWNLIGHT_COUNT 12

//(red * 65536) + (green * 256) + blue ->for 32-bit merged colour value so 16777215 equals white
Expand Down Expand Up @@ -184,7 +185,7 @@ void displayTheTime(){


int secondMinuteDigit = floor(MyDateAndTime.Minute / 10); //work out the value for the second digit and then display it
displayNumber(secondMinuteDigit, 63, clockMinuteColour);
displayNumber(secondMinuteDigit, (7*LED_PER_SEG), clockMinuteColour);


int firstHourDigit = MyDateAndTime.Hour; //work out the value for the third digit and then display it
Expand All @@ -198,7 +199,7 @@ void displayTheTime(){
// }

firstHourDigit = firstHourDigit % 10;
displayNumber(firstHourDigit, 126, clockHourColour);
displayNumber(firstHourDigit, (14*LED_PER_SEG), clockHourColour);


int secondHourDigit = MyDateAndTime.Hour; //work out the value for the fourth digit and then display it
Expand All @@ -212,7 +213,7 @@ void displayTheTime(){
secondHourDigit = secondHourDigit - 12;
}
if (secondHourDigit > 9){
stripClock.fill(clockHourColour,189, 18);
stripClock.fill(clockHourColour,(21*LED_PER_SEG), 18);
}

}
Expand Down
34 changes: 17 additions & 17 deletions Shelf_Edge_Clock_V1/digits.ino
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
void digitZero(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 27);
stripClock.fill(colour, (36 + offset), 27);
stripClock.fill(colour, (0 + offset), (3*LED_PER_SEG));
stripClock.fill(colour, ((4*LED_PER_SEG) + offset), (3*LED_PER_SEG));
}

void digitOne(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 9);
stripClock.fill(colour, (36 + offset), 9);
stripClock.fill(colour, (0 + offset), LED_PER_SEG);
stripClock.fill(colour, ((4*LED_PER_SEG) + offset), LED_PER_SEG);
}

void digitTwo(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 18);
stripClock.fill(colour, (27 + offset), 9);
stripClock.fill(colour, (45 + offset), 18);
stripClock.fill(colour, (0 + offset), (2*LED_PER_SEG));
stripClock.fill(colour, ((3*LED_PER_SEG) + offset), LED_PER_SEG);
stripClock.fill(colour, ((5*LED_PER_SEG) + offset), (2*LED_PER_SEG));
}

void digitThree(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 18);
stripClock.fill(colour, (27 + offset), 27);
stripClock.fill(colour, (0 + offset), 14);
stripClock.fill(colour, ((3*LED_PER_SEG) + offset), (3*LED_PER_SEG));
}

void digitFour(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 9);
stripClock.fill(colour, (18 + offset), 27);
stripClock.fill(colour, (0 + offset), LED_PER_SEG);
stripClock.fill(colour, ((2*LED_PER_SEG) + offset), (3*LED_PER_SEG));
}

void digitFive(int offset, uint32_t colour){
stripClock.fill(colour, (9 + offset), 45);
stripClock.fill(colour, (LED_PER_SEG + offset), (5*LED_PER_SEG));
}

void digitSix(int offset, uint32_t colour){
stripClock.fill(colour, (9 + offset), 54);
stripClock.fill(colour, (LED_PER_SEG + offset), (6*LED_PER_SEG));
}

void digitSeven(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 18);
stripClock.fill(colour, (36 + offset), 9);
stripClock.fill(colour, (0 + offset), (2*LED_PER_SEG));
stripClock.fill(colour, ((4*LED_PER_SEG) + offset), LED_PER_SEG);
}

void digitEight(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 63);
stripClock.fill(colour, (0 + offset), (7*LED_PER_SEG));
}

void digitNine(int offset, uint32_t colour){
stripClock.fill(colour, (0 + offset), 45);
stripClock.fill(colour, (0 + offset), (6*LED_PER_SEG));
}