Simulated Nixie Clock

Through the years I have made electronic clocks of all stages of display techology. Dekatron tubes were an early favourite, I made seven-segment displays with filament lamps driven by DTL logic and transistors, and then LEDs and seven-segment filament displays.

Recently, I saw a lovely dekatron clock on-line and just HAD to make one- but sourcing the components would be troublesome and expensive and time consuming. Instead I cheated- images from an online photo of colour-LED-illuminated nixie tubes gave me the basic images I needed,,

Now I just had to write code to take LB's time$() function and I had a very satisfying display for zero expenditure!

Time is of course net-synchronized to the web time-servers.


    nomainwin

    WindowWidth  = 675
    WindowHeight = 300

    open "Nixie" for graphics_nsb as #wg

    #wg "trapclose quit"

    #wg "down"

    timer 1000, [this]

    wait

  [this]
        timer 0

        now$    =time$()
        print now$

        h$      =word$( now$, 1, ":")
        loadbmp "scr", "nixie_" +mid$( h$, 1, 1) +".bmp"
        #wg "drawbmp scr "; 0 *112 +1; " 1"

        loadbmp "scr", "nixie_" +mid$( h$, 2, 1) +".bmp"

        #wg "drawbmp scr "; 1 *112 +1; " 1"

        m$      =word$( now$, 2, ":")
        loadbmp "scr", "nixie_" +mid$( m$, 1, 1) +".bmp"
        #wg "drawbmp scr "; 2 *112 +1; " 1"

        loadbmp "scr", "nixie_" +mid$( m$, 2, 1) +".bmp"
        #wg "drawbmp scr "; 3 *112 +1; " 1"

        s$      =word$( now$, 3, ":")
        loadbmp "scr", "nixie_" +mid$( s$, 1, 1) +".bmp"
        #wg "drawbmp scr "; 4 *112 +1; " 1"

        loadbmp "scr", "nixie_" +mid$( s$, 2, 1) +".bmp"
        #wg "drawbmp scr "; 5 *112 +1; " 1"

        #wg "color 255 253 144"

        #wg "size 18 ; set "; 1 *112 +80; " 182"
        #wg "size 18 ; set "; 3 *112 +80; " 182"

        timer 1000, [this]
        scan

    wait

    sub quit h$
        close #wg
        end
    end sub


tenochtitlanuk ------- JohnF ------ Apr 2020 ------ mr dot john dot f at gmail.com