But my label displays al sorts of weird stuff, like stuff from Terminal widget, or half names like “BEL” from LABEL. I’m pretty sure this is not the intended use of the setProperty function, but I thought I’d mention it. It would be cool if I could have the Label bet the date or time though.
For nice formatting, yes of course, bur that isn’t the point. It doesn’t get displayed in the labeled value widget. It displays really weird, totally unrelated stuff, like things I write to my terminal widget at vpin 127.
Edit
I al ready put in the current(hour) stufd before since I use that somewhere else too.
Edit more
It now also starts printing stuff from serial output …
void displayTime()
{
// Make into globals, could be usefull anywhere
int currentMinute = minute();
int currentHour = hour();
Blynk.virtualWrite(V16, currentHour);
Blynk.virtualWrite(V17, currentHour);
if(currentMinute < 10)
{
String currentMinute = "0" + minute();
}
if(currentHour < 10)
{
String currentHour = "0" + hour();
}
String currentTime = currentHour + ":" + currentMinute;
Blynk.setProperty(V14, "label", currentTime);
This is the stary from the function. Nothing fancy as far as I can see
Sure. This is C. That’s mean you can easily shoot in the foot . Most probably those concatenation is wrong or there is buffer overflow in setProperty. @vshymanskyy should know better.
Hmm, you could be onto something. The IDE doesn’t mind either way, but I’ll try to put it in separate, correctly initialized strings and see if that helps because everything is messed up now, much more disconnects, unstability etc. And it has been running for months, so it must be something in the code I guess.
I also added all the new (awesome) widgets, but maybe the Mega has some problems with keep up, lol.
This is what I got now. I added Value displays at V16 and 17 and they display the correct hour/minute after RTC has synced, but the label only display the “:”. Must be something with the formatting, but I have no idea what, you guys got any idea?
Any other stuff I forgot in this code? I just want to display the time as the label for a labeled value widget, I don’t know why, but it seems to be handy for some sort of things.