DreamTheaterForums.org Dream Theater Fan Site
General => General Discussion => Topic started by: jasc15 on April 07, 2017, 12:08:08 PM
-
Seems like endless possibilities with these things. I would like to build a nixie clock at some point, but what are some other small projects that would be fun? I think besides the main board, there is an ethernet board and an 8 or so digit LCD display on a small breadboard.
-
I can't speak for Arduino, but I started exploring Raspberry Pis about a year ago. I got one running as a Plex/media server now, and another one has infrared LEDs on a breadboard, to control my projector.
-
I'm starting with making a digital clock using the LCD. My first step is to display seconds with the counter resetting after 60.
t=millis()/1000;
s=t%60;
60 % 60 = 0
61 % 60 = 1
etc.
This should do it, but after 59, it displays 09, 19, 29, ...89, 99, 10, 11...
Whats going on here?
-
No idea, that's pretty wild. I suggest printing out s and t on console.
Is this C, or Python? If it is C, what are the data types of s and t?
-
s and t are integers.
int s, t;
Its apparently a simplified C or C++.
Edit: Ha, its been running for a few hours now, and it is counting down with negative numbers from -59, -58... -11, -10, -90, -80... -20, -10, -010. Could this have anything to do with the control/connection of the LCD?
Edit2: I added 't' to the display. It counts 1 - 60, then 609, 619,... 699, 70, 71... Buuuut, 's' now seems to display as expected.
Strange stuff.
When I have it simply print t without calculating s, it counts as expected. That seems to affect t... Digging now.
-
"-010" definitely is an issue with the displaying, as a -10 would just be displayed as -10.