RTC for my nixie clock

Hello other Arduiners,

Let’s get straight into problem. I need for my nixie clock input from RTC, no big deal right? But trouble is, that I need seperate numbers for each nixie lamp for ex. when it is 22:38 I need them to separate to individual variables like this :
1h = 2
2h = 2
1m = 3
2m = 8.

I hope you understand my problem. Here is code you can modify

ds3231.ino (965 Bytes)

(deleted)

The deal here is that you modify your code and if it does not work the way you want, you post the code (properly in code tags), describe what it does and what it should do. Then we help you to get it working how you want. If you want it done for you, post in Gigs and Collaborations, expect to pay.

Please read the "how to use the forum" stickies to see how to format and post code.

I am actually working on the same exact project right now. I would highly recommend checking out this tutorial here http://www.instructables.com/id/Driving-two-Nixie-tubes-with-an-Arduino-via-a-shif/ He uses a shift register and two 74141n nixie tube driver chips. This will cut down your pins needed on the arduino from 10 to just 3. The shift register will take a byte of data(which can be a dyte that represents say the number 12) and pass it to the driver chip. It will pass each digit to each chip, so a 1 to one chip and a 2 to the other chip. The chip will read it and turn on the appropriate digit. The code provided on that tutorial should explain most of it. If you are still confused I am happy to help more, as I have worked out most of the kinks one mine.

ClydeFrog04

This is not my problem, I already use MH74141 chips for nixie, but I am having problem on how to take from some time separate digits. Because I cannot put input in my nixie’s in format 23:26, I need to put to each nixie separately : 2 - 3 - 2 - 6

GasCZ:
I need to put to each nixie separately : 2 - 3 - 2 - 6

void loop () 
{
  static int lastMinute = 60;
  DateTime now = rtc.now();
  if(now.minute() != lastMinute)
  {
    Serial.print(now.hour());
    Serial.print(':');
    Serial.print(now.minute());
    int nixieMinuteOnes = now.minute() % 10;
    int nixieMinutesTens = now.minute() / 10;
    int nixieHourOnes = now.hour() % 10;
    int nixieHourTens = now.hour() / 10;
    doSomethingNixie();
    lastMinute = now.minute();
  }
}

BulldogLowell:
That is similar to my code, do you have any idea why variable hodiny = now.hour() writes 165 everytime? Same counts for minutes.
Here is the code

// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include <Wire.h>
#include “RTClib.h”

RTC_DS3231 rtc;
int hodiny = 0;
int minuty = 0;

byte cislice1 = 0;
byte cislice2 = 0;
byte cislice3 = 0;
byte cislice4 = 0;

void setup () {

#ifndef ESP8266
#endif

Serial.begin(9600);

}
// Zde se počítají konkrétní čísla pro jednotlivé digitrony - prochy
void decodedigits() {
DateTime now = rtc.now();
hodiny = now.hour();
minuty = now.minute();
Serial.println(hodiny);
Serial.println();
Serial.println(minuty);
Serial.println();
if (hodiny<=9) {
cislice1 = 0;
cislice2 = hodiny;
}
if ((hodiny>=10) && (hodiny<=19)) {
cislice1 = 1;
cislice2 = hodiny - 10;
}
if (hodiny>=20) {
cislice1 = 2;
cislice2 = hodiny - 20;
}
// u cislice 4 je značka “//” ta značí tzv. modulo, který vypíše zbytek po dělení - 26 // 10 = 6

cislice3 = minuty / 10;
cislice4 = minuty % 10;

}

void loop () {

decodedigits();
Serial.println(cislice1);
Serial.println(cislice2);
Serial.println(’:’);
Serial.println(cislice3);
Serial.println(cislice4);
Serial.println();

delay(1000);
}

You can go back and edit your post to use code tags instead of quote tags. It's a pain to read.

GasCZ:
ClydeFrog04

This is not my problem, I already use MH74141 chips for nixie, but I am having problem on how to take from some time separate digits. Because I cannot put input in my nixie's in format 23:26, I need to put to each nixie separately : 2 - 3 - 2 - 6

I know what you mean. I think if you look at that tutorial it might answer your question. What he does is use an array that stores bytes for each number. So you send a byte for say the number 20, and the shift register will separate it into a 2 and a 0 and send each digit where it goes.