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

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

17 Posts
2 Users
5 Reactions
4,457 Views
(@pejman1998)
Active Member
Joined: 5 years 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 4 years ago by pejman1998

   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
 

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().


   
pejman1998 reacted
ReplyQuote
Page 2 / 2
Share: