Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!




Nixie Clock - How c...
 
Share:
Notifications
Clear all

Nixie Clock - How can i add my desired function to this code

Page 2 / 2

(@pejman1998)
Active Member
Joined: 1 year ago
Posts: 9
Topic starter  

@hans thank you for saving me from confusion this time it partially worked whenever it reaches 0 or 30 minutes it cycles thorough numbers with a crazy speed but unfortunately after that the clock stops working like it should and only 2 last digits of clock are glowing while they are not working and they are stuck and frozen besides that it kinda works , im not expert in coding maybe when arduino sees the condition after doing wha we asked it to do doesnt know what to do next , do you know what i mean? while its not 0 or 30 minutes it is an ordinary clock , but when it meets the 0  or 30 condition it should show us an animation of numbers but does it understand after animation it should become lock again?

This post was modified 9 months ago by pejman1998

ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 2027
 

Ah we are making progress 😁 

Although I'm not seeing why the clock stops after a NoPoison ... 

Note:

One thing I had not considered in the previous code, is the time it takes to run NoPoison.
To compensate for that we should maybe read the time again after doing NoPoison.
This should have no impact on the clock that stops working.

I also realized that when setting the time on your clock, the NoPoison may screw that up.
So I added "(mode_step==0)" to make sure we are in "regular time mode", and not in "setting the time mode".

Replace this part, where we call NoPoison in void loop():

    // --- Trigger NoPoison every half hour
    if( ( (minute==0) || (minute==30) ) && (second==0) ) {
      NoPoison();
    }

 

with this  (added mode_step check, AllOff, and reading time again):

    // --- Trigger NoPoison every half hour
    if( ( (minute==0) || (minute==30) ) && (second==0) && (mode_step==0)) {
      NoPoison();
      AllOff();

      // Read time again
      DateTime now = RTC.now();
      hour = now.hour();
      minute = now.minute();
      second = now.second();
    }

 

I highly doubt this will fix the issue you're seeing though.

As far as I can see, the numbers should appear as before. Before NoPoison runs, the clock works correctly right?

From what I get from the code is that there is always at the most 1 nixie ON showing at the most one number.
The switching between tubes goes fast enough that the user doesn't see the tubes going off in between.
The code suggests the numbers will be set each time we run though void loop().


ReplyQuote
Page 2 / 2

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: