The code for the clock is pretty much done. I made it really simple to communicate with all the different nixie tubes. You simply call the function bool Nixies::initialize(unsigned int theSerialPin, unsigned int theSerialClockPin, unsigned int theRegisterClockPin, unsigned int theNixieCount) on the nixies object with all the correct data and then you are able to talk to the nixies with it's simple interface, as an example here is the code to display the time:

DateTime now = RTC.now();
int hour = now.hour();
if (hour>12)
hour -= 12;
if (hour==0)
hour = 12;
int minute = now.minute();
int second = now.second();

nixies.setNixie(5, hour/10);
nixies.setNixie(4, hour%10);
nixies.setNixie(3, minute/10);
nixies.setNixie(2, minute%10);
nixies.setNixie(1, second/10);
nixies.setNixie(0, second%10);
nixies.update();

Pretty much, you set each individual tube to the value you want and then tell it to update the display and the nixies will jump to the value you choose. As another example:

nixies.setNixie(0, 1);
nixies.setNixie(1, 2);
nixies.setNixie(2, 3);
nixies.setNixie(3, 4);
nixies.setNixie(4, 5);
nixies.setNixie(5, 6);
nixies.update();

will display 1 on the right tube and 6 on the left tube. This makes life a lot easier when programming added functionality. If the number to display is 10, it will turn off the nixie.

Previous Post Next Post