Big, Auto Dim, Room Clock (using Arduino and WS2811)

144,458

794

183

First Hello instructables.

This is my first contact with :

  • Instructables
  • Arduino
  • Programmable LED's

So please don't trow rocks at me for noobish mistakes.

Keeping that in mind I'm waiting to read your comments with grate interest and I'm open to any suggestion

Features :

  • big digits ( each digit is approximately the size of a A4 paper).
  • slim in order to fit in a photo frame (a big one).
  • auto dim the light depending on the light in the room.
  • dedicated DST button.

Step 1: Prerequisites

Things I used for this project :

Electronics :

  1. Arduino nano V3.0 (sadly since I can't afford an original arduino I used a chinese clone, for showing my support I donated 2.9 $ to arduino) - 2.9$ on ebay
  2. Digital Light Intensity Sensor Module Photo Resistor for Arduino - 0.99$ on ebay

  3. DS3231 AT24C32 IIC Module Precision Real Time Clock Quare Memory for Arduino - 0.99$ on ebay

  4. DC-DC Buck Converter Step Down Module LM2596 Power Output 1.23V-30V - 0.90$ on ebay

  5. 4m WS2811 led strip 30 leds/m - 12 $ on aliexpress (1 WS2811 IC control 3 LED Chip)

Total cost of electronics : 17.78 $ (without arduino donation)

Miscellaneous :

  1. Heat Shrink Tubing - 7.99$ ebay (assortment, it total 33m)

  2. 20 pcs 5 x 7 cm prototype pcb - 3$ ebay

  3. 3 pcs Micro Switch - 1$ locally bought

  4. Solder - 1$ locally bought

  5. Flux - 1$ locally bought
  6. UTP cable (individual wires used for various connections)
  7. LCD font (http://www.dafont.com/lcd-lcd-mono.font) - free
  8. Cardboard - free loacal supermarket
  9. Polystyrene board - 1.50$ locally bought

Various tools.

Step 2: Preparing - Digit Template

  1. download and install LCD font (http://www.dafont.com/lcd-lcd-mono.font
  2. open word or similar editor and make a template similar to the image (first img)
    • font size ~800,
    • white font color black outline,
    • gray boxes where led strip fits
  3. Print and cut the gray strips with a exacto knife (second img)

Step 3: Preparing - Cut Cardboard and Led Strip

Using the digit template cut the cardboard to size (don't forget to leave space for the dots between hours and minutes)

If your LED strips came with connectors at each end (like mine did) desolder the connector and cut them in sets of 3.

Step 4: Stick the LED Strips

Using the template stick the LED strip on the cardboard.

It's not mandatory but I used a pencil to mark where the LED strips should be placed, this way I got to see the final form before attaching the LED's. It was a good thing since this is how I noticed I left two much space for those dots in the middle, as a result I had stuck the LED strips a little closer.

Step 5: Solder LED Strips

Now starts a long soldering session.

Solder the LED strips in order to form a continues strip.

Notice the order in which to solder the strips in the picture.

For the middle dots I used a single LED strip and covered the middle LED with duct tape.

I used the following color code

  • Blue for ground
  • Green for data
  • Red for Vcc (12v)

Step 6: Wire Arduino on Breadbord

I tried doing a sketch in fritzing but I can't find all the parts :( , Sorry

So here is a list with all the connections and another picture with the setup on a breadboard

Step 7: Test LED's

Before loading this sketch (for which I assume no credit) don't forget to add FastLED library.

If everything went OK the LED's should cycle trough colors. If you have any problems first check your soldered points.

Step 8: Program the Clock

After struggling a little I managed to get a working clock that covers all my needs. I'm sure there is room for improvement.

The code is very commented, if you have any questions please feel free to ask. Also if you have any suggestions, please do tell.

All debugging messages are commented as well.

In order to change the color used you must modify the variable at line 22 ( int ledColor = 0x0000FF; // Color used (in hex)). You can find a list of colors at the bottom of this page: https://github.com/FastLED/FastLED/wiki/Pixel-refe...

If you have problems downloading the code file from instructables here is a mirror : http://bit.ly/1Qjtgg0

Step 9: Make Digits Form Using Polystyrene

Cut each segment in the template printed at the beginning.
Form each digit in the polystyrene using a exacto knife (very hard) or a Hot Wire Cutter.

You can see how I made mine in the pictures.

If you don't have a guitar string you can use just about any thin STEEL wire.

In order to power the Hot Wire Cutter I used the 12v LED power supply.

Also there is a picture with a cut digit. (sorry I forgot to take pictures in the process).

Step 10: Glue Digits and Adding Diffuser

After cutting all 4 digits and the dots glue all of them on the cardboard with the LED strips. (for this process I used
double sided adhesive tape).

In order to diffuse the LED light I used 2 paper sheets on top of the polystyrene. For convenience and aesthetics I used a single A2 size paper folded in two.

Also for finishing touches I've put the entire assembly in a large picture frame.

Time Contest

Second Prize in the
Time Contest

13 People Made This Project!

Recommendations

  • PCB Contest

    PCB Contest
  • Big and Small Contest

    Big and Small Contest
  • Toys Contest

    Toys Contest

183 Discussions

0
None
KadirK15

2 days ago

Bu güzel projeleri derleyip bizlere ulaştıran pinterest.com ailesine sonsuz teşekkürler.

0
None
RobS246

6 months ago on Introduction

I Built this clock it work great, except it looses a few seconds every couple of days.

So what i did is added a NodeMCU ESP-12 WIFI module, now my clock pulls time from NTP server so the clock never looses time. And the RTC is still used just encase he Internet goes down. The WIFI module updates the RTC module.

3 replies
0
None
MartinL136RobS246

Reply 21 days ago

Hi Rob, would you paste your code?
I want to switch my arduino, too.

0
None
TomaszK52RobS246

Reply 4 weeks ago

"1,11, 1" ???????????????????? ,1,1,1,1

0
None
hhenri1RobS246

Reply 5 months ago

can u show how u did that? :D?

0
None
TomaszK52

4 weeks ago

Hello, I'm just learning. please check the code and ask for help in displaying the temperature in the right color. Apologizes for the Google translator.

#include <DS3232RTC.h>
#include <Time.h>
#include <DHT.h>
#include <Wire.h>
#include "FastLED.h"
#define NUM_LEDS 58// Number of LED controles (remember I have 3 leds / controler
#define COLOR_ORDER BRG // Define color order for your strip
#define DATA_PIN 6 // Data pin for led comunication
#define DHTPIN 7
//#define DHTTYPE DHT11
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
CRGB leds[NUM_LEDS]; // Define LEDs strip
byte digits[12][14] = {{0,0,1,1,1,1,1,1,1,1,1,1,1,1}, // Digit 0
{0,0,1,1,0,0,0,0,0,0,0,0,1,1}, // Digit 1
{1,1,1,1,1,1,0,0,1,1,1,1,0,0}, // Digit 2
{1,1,1,1,1,1,0,0,0,0,1,1,1,1}, // Digit 3
{1,1,1,1,0,0,1,1,0,0,0,0,1,1}, // Digit 4
{1,1,0,0,1,1,1,1,0,0,1,1,1,1}, // Digit 5
{1,1,0,0,1,1,1,1,1,1,1,1,1,1}, // Digit 6
{0,0,1,1,1,1,0,0,0,0,0,0,1,1}, // Digit 7
{1,1,1,1,1,1,1,1,1,1,1,1,1,1}, // Digit 8
{1,1,1,1,1,1,1,1,0,0,1,1,1,1},
{1,1,1,1,1,1,1,1,0,0,0,0,0,0},
{0,0,0,0,1,1,1,1,1,1,1,1,0,0}
}; // Digit 9 | 2D Array for numbers on 7 segment
// {11111111000000}, // Digit *0
// {00001111111100}}
bool TempShow = true;
bool Dot = true; //Dot state
bool DST = true; //DST state
//int ledColor = 0x0000FF; // Color used (in hex)
int last_digit = 1;
long ledColor = CRGB::DarkOrchid; // Color used (in hex)
//long ledColor = CRGB::MediumVioletRed;
//Random colors i picked up
long ColorTable[16] = {
CRGB::Amethyst,
CRGB::Aqua,
CRGB::Blue,
CRGB::Chartreuse,
CRGB::DarkGreen,
CRGB::DarkMagenta,
CRGB::DarkOrange,
CRGB::DeepPink,
CRGB::Fuchsia,
CRGB::Gold,
CRGB::GreenYellow,
CRGB::LightCoral,
CRGB::Tomato,
CRGB::Salmon,
CRGB::Red,
CRGB::Orchid
};
void setup(){
Serial.begin(9600);
Wire.begin();
dht.begin();
LEDS.addLeds<WS2811, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS); // Set LED strip type
LEDS.setBrightness(255); // Set initial brightness
pinMode(2, INPUT_PULLUP); // Define DST adjust button pin
pinMode(4, INPUT_PULLUP); // Define Minutes adjust button pin
pinMode(5, INPUT_PULLUP); // Define Hours adjust button pin
}
// Get time in a single number, if hours will be a single digit then time will be displayed 155 instead of 0155
int GetTime(){
// RTC.setDateTime(__DATE__, __TIME__);
tmElements_t Now;
RTC.read(Now);
//time_t Now = RTC.Now();// Getting the current Time and storing it into a DateTime object
int hour=Now.Hour;
int minutes=Now.Minute;
int second =Now.Second;
if (second % 2==0) {Dot = false;}
else {Dot = true;};
return (hour*100+minutes);
};
// Check Light sensor and set brightness accordingly
void BrightnessCheck(){
const byte sensorPin = 11; // light sensor pin
const byte brightnessLow = 30; // Low brightness value
const byte brightnessHigh =30 ; // High brightness value
int sensorValue = digitalRead(sensorPin); // Read sensor
if (sensorValue == 0) {LEDS.setBrightness(brightnessHigh);}
else {LEDS.setBrightness(brightnessLow);}
};
void TempToArray(){
tmElements_t tm;
RTC.read(tm);
if (tm.Second != 47) {
TempShow =false;
return;
}
TempShow = true;
int t = dht.readTemperature();
//int celsius = (t / 4.0) * 100;
int celsius =(t);
Serial.print("Temp is: ");
int cursor = 59; // last led number
leds[28]=0x000000;
leds[29]=0x000000;
for(int i=0;i<=13;i++){
int digit = celsius % 10; // get last digit in time
if (i==4){
Serial.print("Digit 4 is : ");
Serial.print(digit);Serial.print(" ");
cursor = 44;
for(int k=0; k<=13;k++){
Serial.print(digits[11][k]);
if (digits[11][k]== 1){leds[cursor]=ledColor;}
else if (digits[11][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println();
}
else if (i==3){
Serial.print("Digit 3 is : ");Serial.print(digit);Serial.print(" ");
cursor =30;
for(int k=0; k<=13 ;k++){
Serial.print(digits[10][k]);
if (digits[10][k]== 1){leds[cursor]=ledColor;}
else if (digits[10][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println();
}
else if (i==2){
Serial.print("Digit 2 is : ");Serial.print(digit);Serial.print(" ");
cursor =14;
for(int k=0; k<=13;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){leds[cursor]=ledColor;}
else if (digits[digit][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println();
}
else if (i==1){
Serial.print("Digit is : ");Serial.print(digit);Serial.print(" ");
cursor =0;
for(int k=0; k<=13;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){leds[cursor]=ledColor;}
else if (digits[digit][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println();
}
celsius /= 10;
};
};
// Convert time to array needet for display
void TimeToArray(){
int Now = GetTime(); // Get time
int cursor =59;
Serial.print("Time is: ");Serial.println(Now);
if (DST){ // if DST is true then add one hour
Now+=100;
Serial.print("DST is ON, time set to : ");Serial.println(Now);
};
if (Dot){leds[29]=ledColor;
leds[28]=ledColor;
}
else {leds[29]=0x000000;
leds[28]=0x000000;
};
for(int i=1;i<=4;i++){
int digit = Now % 10; // get last digit in time
if (i==1){
Serial.print("Digit 4 is : ");Serial.print(digit);Serial.print(" ");
cursor =44;
for(int k=0 ; k<=13 ;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){leds[cursor]=ledColor;}
else if (digits[digit][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println(); Serial.println();
}
else if (i==2){
Serial.print("Digit 3 is : ");Serial.print(digit);Serial.print(" ");
cursor =30;
for(int k=0; k<=13;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){leds[cursor]=ledColor;}
else if (digits[digit][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println();
}
else if (i==3){
Serial.print("Digit 2 is : ");Serial.print(digit);Serial.print(" ");
cursor =14;
for(int k=0; k<=13;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){leds[cursor]=ledColor;}
else if (digits[digit][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println();
if (digit != last_digit)
{
cylon();
ledColor = ColorTable[random(16)];
}
last_digit = digit;
}
else if (i==4){
Serial.print("Digit1 is : ");Serial.print(digit);Serial.print(" ");
cursor =0;
for(int k=0; k<=13;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){leds[cursor]=ledColor;}
else if (digits[digit][k]==0){leds[cursor]=0x000000;};
cursor ++;
};
Serial.println();
}
Now /= 10;
};
};
void DSTcheck(){
int buttonDST = digitalRead(2);
// Serial.print("DST is: ");Serial.println(DST);
if (buttonDST == LOW){
if (DST){
DST=false;
// Serial.print("Switching DST to: ");Serial.println(DST);
}
else if (!DST){
DST=true;
// Serial.print("Switching DST to: ");Serial.println(DST);
};
delay(500);
};
}
void TimeAdjust(){
int buttonH = digitalRead(5);
int buttonM = digitalRead(4);
if (buttonH == LOW || buttonM == LOW){
delay(100);
tmElements_t Now;
RTC.read(Now);
int hour=Now.Hour;
int minutes=Now.Minute;
int second =Now.Second;
if (buttonH == LOW){
if (Now.Hour== 23){Now.Hour=0;}
else {Now.Hour += 1;};
}else {
if (Now.Minute== 59){Now.Minute=0;}
else {Now.Minute += 1;};
};
RTC.write(Now); }}
void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); }}
void cylon () {
static uint8_t hue = 0;
Serial.print("x");
// First slide the led in one direction
for(int i = 0; i < NUM_LEDS; i++) {
// Set the i'th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(15);
}
Serial.print("x");
// Now go in the other direction.
for(int i = (NUM_LEDS)-1; i >= 0; i--) {
// Set the i'th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(15);
}
}
void loop() // Main loop
{
int t = dht.readTemperature();
Serial.print("Temperatura: ");
Serial.print(t);
BrightnessCheck(); // Check brightness
DSTcheck(); // Check DST
TimeAdjust(); // Check to se if time is geting modified
TimeToArray(); // Get leds array with required configuration
TempToArray();
FastLED.show(); // Display leds array
if (TempShow == true) delay (7000);
}

0
None
Mikhail85

8 weeks ago

sketch_oct14c:79:1: error: missing terminating " character

Serial.println("Brightness High

^

sketch_oct14c:87:1: error: missing terminating " character

Serial.println("Brightness Low

^

sketch_oct14c:177:1: error: missing terminating " character

Serial.print("Digit 4 is : ");Serial.print(digit);Serial.print(", the array is

^

sketch_oct14c:199:1: error: missing terminating " character

Serial.print("Digit 3 is : ");Serial.print(digit);Serial.print(", the array is

^

sketch_oct14c:221:1: error: missing terminating " character

Serial.print("Digit 2 is : ");Serial.print(digit);Serial.print(", the array is

^

sketch_oct14c:243:1: error: missing terminating " character

Serial.print("Digit 1 is : ");Serial.print(digit);Serial.print(", the array is

^

In file included from C:\Users\Mikhail\AppData\Local\Temp\arduino_modified_sketch_481442\sketch_oct14c.ino:7:0:

C:\Users\Mikhail\Documents\Arduino\libraries\FastLED-master/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.000

# pragma message "FastLED version 3.002.000"

^

sketch_oct14c:49:1: error: expected initializer before 'Serial'

Serial.begin(9600

^

In file included from C:\Users\Mikhail\AppData\Local\Temp\arduino_modified_sketch_481442\sketch_oct14c.ino:7:0:

C:\Users\Mikhail\Documents\Arduino\libraries\FastLED-master/FastLED.h:563:14: error: 'FastLED' does not name a type

#define LEDS FastLED

^

C:\Users\Mikhail\AppData\Local\Temp\arduino_modified_sketch_481442\sketch_oct14c.ino:55:1: note: in expansion of macro 'LEDS'

LEDS.setBrightness(255); // Set initial brightness

^

sketch_oct14c:57:8: error: expected constructor, destructor, or type conversion before '(' token

pinMode(2, INPUT_PULLUP); // Define DST adjust button pin

^

sketch_oct14c:59:8: error: expected constructor, destructor, or type conversion before '(' token

pinMode(4, INPUT_PULLUP); // Define Minutes adjust button pin

^

sketch_oct14c:61:8: error: expected constructor, destructor, or type conversion before '(' token

pinMode(5, INPUT_PULLUP); // Define Hours adjust button pin

^

sketch_oct14c:63:1: error: expected declaration before '}' token

}

^

exit status 1

missing terminating " character

2018-10-14_19-55-08.png
0
None
AaronD44

Question 3 months ago

How would you go about adding a third set of digits for seconds. I want to be able to use this as a clock and a timer.

0
None
Evan31

Question 4 months ago

I have no idea what i am doing wrong, I can not get the leds to work, I have tried just a strip of them to test to see if it was the solder, but it doesn't work. Here is the code i am using.

#include <DS3232RTC.h>

#include <Time.h>

#include <Wire.h>

#include "FastLED.h"

#define NUM_LEDS 71 // Number of LED controles (remember I have 3 leds / controler

#define COLOR_ORDER BRG // Define color order for your strip

#define DATA_PIN 6 // Data pin for led comunication

CRGB leds[NUM_LEDS]; // Define LEDs strip

byte digits[10][35] = {{0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, // Digit 0

{0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1}, // Digit 1

{1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,}, // Digit 2

{1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1}, // Digit 3

{1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1}, // Digit 4

{1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1}, // Digit 5

{1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, // Digit 6

{0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1}, // Digit 7

{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, // Digit 8

{1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1}}; // Digit 9 | 2D Array for numbers on 7 segment

byte firstdigit[2][10] = {{0,0,0,0,0,0}, // Digit 0 first number

{1,1,1,1,1,1}}; // Digit 1 first number | 2D Array for numbers on 7 segment

bool Dot = true; //Dot state

bool DST = false; //DST state

long ledColor = 0xDC143C; // Color used (in hex)

void setup(){

Serial.begin(9600);

Wire.begin();

LEDS.addLeds<WS2812B, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS); // Set LED strip type

LEDS.setBrightness(255); // Set initial brightness

pinMode(2, INPUT_PULLUP); // Define DST adjust button pin

pinMode(4, INPUT_PULLUP); // Define Minutes adjust button pin

pinMode(5, INPUT_PULLUP); // Define Hours adjust button pin

}

// Check Light sensor and set brightness accordingly

void BrightnessCheck(){

const byte sensorPin = 3; // light sensor pin

const byte brightnessLow = 75; // Low brightness value

const byte brightnessHigh = 100; // High brightness value

int sensorValue = digitalRead(sensorPin); // Read sensor

if (sensorValue == 0) {

Serial.println("Brightness High");

LEDS.setBrightness(brightnessHigh);

}

else {

Serial.println("Brightness Low");

LEDS.setBrightness(brightnessLow);

}

};

// Get time in a single number

int GetTime(){

tmElements_t Now;

RTC.read(Now);

int hour=Now.Hour;

if (DST) { if (hour==24) {hour=1;}

else {hour += 1;}

};

if (hour>12 ){hour -= 12;};

int minutes=Now.Minute;

int second =Now.Second;

if (second % 2==0) {Dot = false;}

else {Dot = true;};

return (hour*100+minutes);

};

void DSTcheck(){

int buttonDST = digitalRead(2);

Serial.print("DST is: ");Serial.println(DST);

if (buttonDST == LOW){

if (DST){

DST=false;

Serial.print("Switching DST to: ");Serial.println(DST);

}

else if (!DST){

DST=true;

Serial.print("Switching DST to: ");Serial.println(DST);

};

delay(500);

};

}

// Convert time to array needet for display

void TimeToArray(){

int Now = GetTime(); // Get time

int cursor = 116;

Serial.print("Time is: ");Serial.println(Now);

if (Dot){leds[45]=ledColor;leds[46]=ledColor;}

else {leds[45]=0x000000;leds[46]=0x000000;};

for(int i=1;i<=4;i++){

int digit = Now % 10; // get last digit in time

if (i==1){

cursor =82;

Serial.print("Digit 4 is : ");Serial.print(digit);Serial.print(", the array is : ");

for(int k=0; k<=34;k++){

Serial.print(digits[digit][k]);

if (digits[digit][k]== 1){leds[cursor]=ledColor;}

else if (digits[digit][k]==0){leds[cursor]=0x000000;};

cursor ++;

};

Serial.println();

}

else if (i==2){

cursor =47;

Serial.print("Digit 3 is : ");Serial.print(digit);Serial.print(", the array is : ");

for(int k=0; k<=34;k++){

Serial.print(digits[digit][k]);

if (digits[digit][k]== 1){leds[cursor]=ledColor;}

else if (digits[digit][k]==0){leds[cursor]=0x000000;};

cursor ++;

};

Serial.println();

}

else if (i==3){

cursor =10;

Serial.print("Digit 2 is : ");Serial.print(digit);Serial.print(", the array is : ");

for(int k=0; k<=34;k++){

Serial.print(digits[digit][k]);

if (digits[digit][k]== 1){leds[cursor]=ledColor;}

else if (digits[digit][k]==0){leds[cursor]=0x000000;};

cursor ++;

};

Serial.println();

}

else if (i==4){

cursor =0;

Serial.print("Digit 1 is : ");Serial.print(digit);Serial.print(", the array is : ");

for(int k=0; k<=9;k++){

Serial.print(firstdigit[digit][k]);

if (firstdigit[digit][k]== 1){leds[cursor]=ledColor;}

else if (firstdigit[digit][k]==0){leds[cursor]=0x000000;};

cursor ++;

};

Serial.println();

};

Now /= 10;

};

};

void TimeAdjust(){

int buttonH = digitalRead(5);

int buttonM = digitalRead(4);

if (buttonH == LOW || buttonM == LOW){

delay(500);

tmElements_t Now;

RTC.read(Now);

int hour=Now.Hour;

int minutes=Now.Minute;

if (buttonH == LOW){

if (Now.Hour== 24){Now.Hour=1;}

else {Now.Hour += 1;};

}else {

if (Now.Minute== 59){Now.Minute=0;}

else {Now.Minute += 1;};

};

RTC.write(Now);

}

}

void loop() // Main loop

{

BrightnessCheck(); // Check brightness

DSTcheck(); // Check DST

TimeAdjust(); // Check to se if time is geting modified

TimeToArray(); // Get leds array with required configuration

FastLED.show(); // Display leds array

}

0
None
ИгорьБ27

11 months ago

It does not load ... Here's the error.

Arduino: 1.8.5 (Windows 10), Плата:"Arduino Nano, ATmega328P"

In file included from C:\FLTK1MPIGJOSU6N\FLTK1MPIGJOSU6N.ino:1:0:

C:\Users\Игорь\Documents\Arduino\libraries\DS3232RTC-master/DS3232RTC.h:136:26: error: 'tmElements_t' has not been declared

static byte read(tmElements_t &tm);

^

C:\Users\Игорь\Documents\Arduino\libraries\DS3232RTC-master/DS3232RTC.h:137:20: error: 'tmElements_t' has not been declared

byte write(tmElements_t &tm);

^

In file included from C:\FLTK1MPIGJOSU6N\FLTK1MPIGJOSU6N.ino:4:0:

C:\Users\Игорь\Documents\Arduino\libraries\FastLED-master/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.005

# pragma message "FastLED version 3.001.005"

^

C:\FLTK1MPIGJOSU6N\FLTK1MPIGJOSU6N.ino: In function 'int GetTime()':

FLTK1MPIGJOSU6N:34: error: 'tmElements_t' was not declared in this scope

tmElements_t Now;

^

FLTK1MPIGJOSU6N:35: error: 'Now' was not declared in this scope

RTC.read(Now);

^

C:\FLTK1MPIGJOSU6N\FLTK1MPIGJOSU6N.ino: In function 'void TimeAdjust()':

FLTK1MPIGJOSU6N:138: error: 'tmElements_t' was not declared in this scope

tmElements_t Now;

^

FLTK1MPIGJOSU6N:139: error: 'Now' was not declared in this scope

RTC.read(Now);

^

exit status 1

'tmElements_t' was not declared in this scope

3.jpg
1 reply
0
None
najob

Question 8 months ago

hi, someone can tell me how to add temp display please,

thanks

0
None
marcelh32najob

Answer 8 months ago

I have used a DS3231 works like a charm

0
None
MariusB49

Question 8 months ago

Hello everyone,

Can you tell me please, what did you put in front of the leds to create the feelling of a single led/ per segment? What kind of material?

Thanks,

Marius

0
None
Karitomua

8 months ago

Excellent project, there is a lot of information to develop it right now I was looking for some project to do it as a college assignment and I think it fits me like a glove.

Regards

0
None
marcelh32

Question 8 months ago on Introduction

I've red in the comments that it is possible to display seconds , can you give me some idea's how to ?

0
None
RaimisS

1 year ago

Hi everyone,

I have replicated this project with some additions. Here you will find my code: https://github.com/Barcors/WS2812B_TemperatureCloc...

I have added Dallas sensor for measuring outside temperatures. Positive temperature are working good but I am not success with negative temperatures. Might be someone can help me with this. I do not know how to light up minus and corectly diplay negative temperatures. Thanks