Upgraded Clock program in English

Startseite Foren LED-Nixie-Clock Upgraded Clock program in English

  • Dieses Thema hat 32 Antworten und 10 Teilnehmer, und wurde zuletzt aktualisiert vor 5 Jahre von tomtom.
Ansicht von 15 Beiträgen - 1 bis 15 (von insgesamt 33)
  • Autor
    Beiträge
  • #1224
    Doug Paulley
    Teilnehmer

    I have extended and upgraded the Nixie clock program originally written by „Vanessa“.
    You can download Version D1.00 here.

    Some of the upgrades include:

    • 12 / 24 hour clock choice
    • European / American / YYMMDD date display
    • Silence the alarm by clicking the button
    • Reset the EEPROM by holding button during version display (I found that holding during startup didn’t work)
    • Lots of minor UI tweaks
    • Extensive commenting in the code, in English, describing what’s going on

    Also doubtless a lot of stuff I’ve forgotten, and doubtless bugs I have introduced into the existing code 🙂 so use at your own risk.

    Kudos to Diamex and Vanessa for the program, I just extended it.

    I also have some basic notes on the program – giving the colour presets, EEPROM locations and line numbers of key functions.

    Here’s the header to the program, describes a little more.

    ‚ *************************************
    ‚ * LED-NIXIE Clock Demo *
    ‚ * LED-Basic >= 15.1.14 required *
    ‚ * modified by Doug Ver. D1.00 *
    ‚ * from Vanessa’s version 1.46 *
    ‚ *************************************

    ‚Operations manual:

    ‚On startup, the display shows the software version for approx. 3 seconds.
    ‚To reset to factory defaults: as soon as the software version number displays,
    ‚press and hold the button until unit beeps.

    ‚Usage:

    ‚Turn the knob to adjust the display colour.
    ‚Short press knob to switch between Clock and Date display,
    ‚Changing display also ensures colour setting is saved when restarting.
    ‚Date display automatically returns to clock display after approx. 3 seconds.

    ‚Long press spinner button during time display to enter settings menu (white).
    ‚Long press button during date display to enter the system menu (blue).
    ‚Turn knob to choose an option, short press to select, long press to exit.
    ‚After 4 seconds inactivity, the unit returns to display mode
    ‚ (without saving changes).

    ‚Settings menu (white):
    ‚Setting 0: beeper on / off (default 1)
    ‚ 0 = off
    ‚ 1 = on
    ‚Setting 1: 12 / 24 hour clock display (default 24)
    ‚ 12 = 12 hour clock
    ‚ 24 = 24 hour clock
    ‚Setting 2: Set the time (24 hour clock)
    ‚ Short press changes between hours, minutes, seconds
    ‚ long press saves the time
    ‚Setting 3: Date format display (1)
    ‚ 1 = DDMMYY
    ‚ 2 = MMDDYY
    ‚ 3 = YYMMDD
    ‚Setting 4: Set the date
    ‚ Short press changes between days, months, years
    ‚ long press saves the date
    ‚Setting 5: Alarm on / off (default 0)
    ‚ 0 = off
    ‚ 1 = on
    ‚Setting 6: Set alarm time (24 hour clock, default 12:00)
    ‚ Short press changes between hours and minutes
    ‚ Long press saves the alarm time
    ‚Setting 7: Auto date display on / off (default 0)
    ‚ 0 = off
    ‚ 1 = on
    ‚Setting 8: Timer (max 23:59:00)
    ‚ Short press changes between hours and minutes
    ‚ Long press sets timer duration
    ‚ Then short press to start / stop timer
    ‚ To exit, long press whilst timer stopped
    ‚Setting 9: Stopwatch (max 23:59:59)
    ‚ Short press to start / stop stopwatch
    ‚ To exit, long press whilst stopwatch stopped

    ‚System menu (blue):
    ‚System 0: adjust brightness (default 12)
    ‚ 1..15 = brightness level,
    ‚ 0 = automatic brightness (set using sensor)
    ‚System 1: Minimum brightness for auto brightness (default 1)
    ‚ 0 … 15 = minimum brightness
    ‚System 2: Time correction offset addition or subtraction (default 1)
    ‚ 0 = subtract offset seconds from time each day
    ‚ 1 = add offset seconds to time each day
    ‚System 3: set time correction (default 0)
    ‚ 0..10 = Offset in seconds per 24 hours (updated at 02:00)
    ‚System 4: Party Mode On / Off (default 0)
    ‚ 0 = off
    ‚ 1 = on
    ‚System 5: Slot machine mode on / off (default 0)
    ‚ 0 = off
    ‚ 1 = on
    ‚Position 6: Second flipping mode on / off (1)
    ‚ 0 = off
    ‚ 1 = on

    ‚All settings remain in case of power failure (EEPROM).
    ‚The alarm is prioritised over the timer and stopwatch.
    ‚The slot machine, party mode and seconds flipping modes can be
    ‚turned on or off.
    ‚Slot machine mode: at 4, 8, 14, 18, 24… minutes past the hour, LEDs are lit
    ‚at random for 10 seconds.
    ‚Party mode: every other minute (01, 03, 05…), one of 7 „party ‚displays“ at
    ‚random are shown for a few seconds.
    ‚Second flipping mode: on flipping from ‚9‘ to ‚0‘, the seconds display
    ‚cycles through 9…8…7… …0.
    ‚When alarm is On, alarm time displays twice every ten minutes (minutes 02, 06,
    ’12, 16, 22…) in red.

    ‚If connected to a PC running LED-Basic, the current EEPROM values are
    ‚displayed on the screen at program start for debugging purposes.

    ‚This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
    ‚International License. http://creativecommons.org/licenses/by-sa/4.0/
    ‚******************************************************************************
    ### L60 CGRB P1 S2 M92 F40
    ‚ Set initial EEPROM state (for testing, uncomment to set on run)
    ‚ IO.eewrite(1, 1) ‚ 1 = Time Colour (1)
    ‚ IO.eewrite(2, 5) ‚ 2 = Date Colour (5)
    ‚ IO.eewrite(3, 1) ‚ 3 = Beep (1)
    ‚ IO.eewrite(4, 12) ‚ 4 = Brightness (12)
    ‚ IO.eewrite(5, 0) ‚ 5 = Alarm (0)
    ‚ IO.eewrite(6, 12) ‚ 6 = Alarm Hour (12)
    ‚ IO.eewrite(7, 0) ‚ 7 = Alarm Minute (0)
    ‚ IO.eewrite(8, 0) ‚ 8 = Auto Date Display (0)
    ‚ IO.eewrite(9, 0) ‚ 9 = Party Mode (0)
    ‚ IO.eewrite(10, 0) ‚ 10 = Time Offset (0)
    ‚ IO.eewrite(11, 1) ‚ 11 = Time Offset +/- (1)
    ‚ IO.eewrite(12, 7) ‚ 12 = Min Auto Bright (2)
    ‚ IO.eewrite(13, 0) ‚ 13 = Slot Machine (0)
    ‚ IO.eewrite(14, 1) ‚ 14 = 24 Hour Clock (1)
    ‚ IO.eewrite(15, 1) ‚ 15 = Seconds flip (1)
    ‚ IO.eewrite(16, 0) ‚ 16 = Date format (0)

    #1230
    Folker Stange
    Verwalter

    cool stuff 🙂

    #1231

    Hi Doug,

    thanks for this file. It’s awesome work. We like it very much. Thanks for your praise. Our team invested a lot of work in the clock and its concept and we’re always happy when there is someone who likes it – and even more so when someone has a lot of fun!

    As for the bugs you mentioned: Vanessa had a look at your file and took care of them. She said that you’ve done very good work.

    We posted the new combined file here. Of course, we’d love to hear your feedback on this.
    https://www.led-genial.de/LED-Basic-Downloads

    We will put a link to this new file in our FAQ and we will share the news on Youtube where many users asked for the changes you’ve made so more people find out about your nice work!

    Thanks a lot!

    #1232
    Doug Paulley
    Teilnehmer

    hi!

    Thank you. I do indeed thoroughly enjoy the Cronixie. I may buy another kit for another room! And thank you very much for looking over my code.

    A couple of comments on the changes (re)introduced by Vanessa.

    • I find that holding down the button whilst plugging the USB lead in does not trigger the CRONIOS1 to run the EEPROM reset routine. In fact when holding down the button whilst restarting, the CRONIOS1 doesn’t load its program at all. It simply blinks the LEDs on the PCB:

      That is why I implemented a slightly different EEPROM reset routine.

    • I changed the minimum LED brightness function to look up brightness values from the brightness table, because to me that makes sense than simply adding values 1-15 (or 1-30 under version 1.46) to the measured brightness. Simply adding 15 to a brightness may not result in a sufficient change to the minimum, in my view.
    • Clocks starting digit „0“ always come across as 24 hour, at least here in the UK. Hence I hide the 0 on 12 hour display.

      See e.g. https://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_Kingdom#English_2
      16:30 (24h) is written 4:30pm (12h) not 04:30pm
      09:18 (24h) is written 9:18am (12h) not 09:18
      But this is doubtless a matter of personal taste and preference. In fact I think I prefer your way, even though it’s „non-standard“ in the UK.

    Bugs: thank you for fixing my bug with Date display colours being saved as Time display colours, also settings being saved when timed out.

    As regards the latter: the various lines reading „goto 10005 ' return to system menu without save“ should perhaps say „goto 10005 ' return to settings menu without save“ to be compliant with the header description.

    Incrementing the counter by 4 in the Slot Machine subroutine: Vanessa states this is to change the Colour, as it is elsewhere in the program. But the Colour doesn’t change during the Slot Machine, it is White throughout. The counter value is set but makes no difference during Slot Machine. Not a bug as such, just extraneous.

    The other changes, e.g. turning off encoder wrap-around, „Off“ and „On“ options both showing on 50 rather than 40 and 50, date format choices 0-2 rather than 1-3, padding in comments etc. are doubtless personal preference – I prefer my version 🙂

    I’ve incorporated some of Vanessa’s updates and changes into my version D1.01.

    Thank you!

    Doug

    • Diese Antwort wurde geändert vor 6 Jahre, 11 Monaten von Doug Paulley.
    #1235
    Doug Paulley
    Teilnehmer

    Version D1.02.

    Changes from D1.01:

    • Offset (seconds) now accepted up to 29 seconds (my RTC drifts quite a lot)
    • Menu order changed so all date-related items are grouped
    • Timer starts on long-press, no need to do further short-press
    • Timer can be set to a 5 second interval
    • Changed the tune for timer complete – tune probably memorable to British people 🙂
    #1260

    Now that you mention it, you’re right about the zero. Our media are also dominated by American films and series. You’ve seen that so often but it remains a subconscious thing you’re not thinking of.

    We’re in good company, though. This also happens the other way round. 😉 Clocks from the anglophone world have three letters for the days of the week (Mon, Tue…). In the German-speaking area you only need two ones, though (Mo, Di…). Three letters are simply not used.
    The combination of these systems is not a good idea. There are clocks with three letters that show you the German names of the days. Seriously, there were patients in hospitals in the UK who got a panic attack because they were completely irritated by the clock displaying the first three letters of „Dienstag“ (Tuesday).

    #1285
    Jon
    Teilnehmer

    A few weeks ago I build my clock, and over the weekend I built a box to put it in. I did download and install the English version of the software and installed it, but I had a few issues.

    First, my clock has a drift of about 45 seconds per day. Second, there are a lot of extras that I really didn’t care for, so I sat down and modified the 1.5 clock.

    I rewrote the time drift calculations so they are done real-time, and updates the RTC at midnight. I extended the maximum drift to 99 seconds.

    Additionally, I attempted to replicate something that looks more like a 1940s/50s side lit display by adding an additional color that looks more like an incandescent light bulb.

    As part of my attempt to make this thing look „old“, I added a fade between numbers (so when a number changes it fades out quickly, and fades the next one in).

    Additionally I added a flicker, which randomly flickers numbers (as if the bulbs are old or bad grounding).

    Note that I stripped out a bunch of stuff. I removed the alarm, stopwatch, slot machine, party mode, and second flip options/code. Additionally I had to remove the buzzer off of my controller board because it sat too high (I was going to resolder it under the board where it would fit, but it broke when I attempted to remove it), so I haven’t verified that the buzzer works properly.

    My photo looks pink, but in person it’s an off-white color.

    My clock

    Here’s a link to my file: https://www.dropbox.com/s/g3oor6vxk4ec6ig/LED-Nixie-Clock-2.00.js.bas.txt

    I haven’t fully tested the 24 hour mode, and I’m still verifying that my method to combat drift is working properly, but I figured I’d release it into the wild and see what people thought.

    #1286
    Jon
    Teilnehmer

    Here is a link to a youtube video of the flicker and fade in action (the setting allows for more, or less of both)

    #1294

    Hi Jon, that’s really cool! It’s very retro and it really looks as if it comes right from the 50s. The flicker and fade definitely create that atmosphere. We’ve already tested your software version and like it a lot 🙂

    As for the buzzer: you can replace the buzzer by any loudspeaker.

    #1295
    Chris
    Teilnehmer

    Hello all!

    I too was hoping to update the firmware on my clock to Doug’s US code as it is hosted on https://www.led-genial.de/LED-Basic-Downloads

    Unfortunately, I was getting numerous errors while trying to run LED-Basic and connect to the Cronios. I could load the BASIC file and attempt to „Create and Upload“ (green button) however I would see Writefile Function Failed (error: 121) over and over again.

    I tried this repeatedly and on my final attempt, after i got the 121 error I unplugged my Cronios from my PC and back into just USB power, and it no longer powered on or functioned. Only the red and green LEDs flash about 3x per second. I tried connecting it back to my PC via USB and now no device is recognized at all. Just flashing red/green LEDs.

    I am afraid the failed flash attempt has corrupted the firmware on my Cronios. Is there any way to recover? If not, can I purchase just the Cronios unit by itself?

    I’m pretty bummed my new clock appears to be bricked! Any help would be greatly appreciated

    #1296
    Folker Stange
    Verwalter

    Hi Chris. The firmware cannot bricked on the LED-Basic Controller. Red and green flashes, this means there is no Basic-Code available in memory. But it can be updated easily with the LED-Basic tool. If the tool doesn’t work, please check your installation. Try to deinstall all and renew the installation. Start the installer and the LED-Basic tool „as administrator“. It works perfectly on thousands other PC, why not on yours? Try another PC, ask a specialist who can help you.

    #1297
    Chris
    Teilnehmer

    Hi Folker Strange. Unfortunately the Cronios unit itself is no longer being detected when plugged into any PC via USB. When before windows would detect it and create an COM device within device manager, now absolutely nothing happens. Therefore within the LED-Basic application, I cannot select a COM device that corresponds with the Cronios and cannot send data to it.

    This is what made me come to the conclusion that the firmware somehow was corrupted.

    *edit*

    Success! It turns out that 3 of the 4 mini USB cables I have were the culprit. I have now updated to v2.00 from Jon.

    Unfortunately I have a new problem now! I cannot change any settings other than brightness, date, or time (0, 1, 2) due to what appears to be a bug in the code. If I scroll to any setting other than those and short click, the unit freezes and resets, and my debugger in the terminal shows „?ERROR 20 IN LINE 770“

    Also, while it appears the second fade and flickering functions are supposed to be enabled by default (comment in the code as value 5 of 0-9), these are not enabled and since I cannot change settings I cant really try to enable them. They also do not seem to be variables set during EEPROM initialization.

    Jon, do you see any syntax errors in line 770? I did a very simple debug read-through of my own but couldn’t find any problems.

    #1298
    Jon
    Teilnehmer

    Chris, I reused some eeprom values from the older clock values. If they were out of range from the old values it would crash. I’ve added some bounds that should (crossing fingers) prevent that.

    I also realized my RTC drift code wasn’t working quite right, so I spent the last few days rewriting it. I think this operates better.

    Additionally changed the date editor so the order of editing matches your date format. Lastly I tried to clean up some variable usage to free up some variables in case anyone needs variables in the future!

    https://www.dropbox.com/s/dik3ud4390uob0z/LED-Nixie-Clock-2.01.js.bas.txt?dl=0

    #1299
    Jon
    Teilnehmer

    Lastly, my additional options should be enabled by default if you do a eeprom reset by holding the dial when plugging in power. That would have also fixed your bombing code.

    I will admit that this is very much „beta“ code mostly for my own edification and purposes. I will do my best to debug/fix issues that anyone finds. I’m not really testing beyond my own specific install (12 hour time, US date display, etc). I’m trying to be agnostic enough that other configurations should work too.

    #1303
    Jon
    Teilnehmer

    I found and squashed a few more bugs. I also freed up a few more variables for future use. Hopefully this is the last update in a while.

    https://www.dropbox.com/s/ougi28d0vcmyuyx/LED-Nixie-Clock-2.02.js.bas.txt

    If you need to contact me, feel free at led-basic.driestone@surfspamfree.com

    Cheers!

Ansicht von 15 Beiträgen - 1 bis 15 (von insgesamt 33)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.