// Get time in seconds. // NOTE: Change this value from 1000 to a lower number to slow down the clock to debug. long time = (runTime) / 1000;

// Set time based on offset.. long hbump = 60*60*clockHourSet; long mbump = 60*clockMinSet; time += mbump + hbump;

// Convert time to days,hours,mins,seconds long days = time / DAYS; time -= days * DAYS; long hours = time / HOURS; time -= hours * HOURS; long minutes = time / MINS; time -= minutes * MINS; long seconds = time; long sseconds = 0;

The example fader sketch is for a 6-tube setup. Also, for whatever reason the pin declarations are different than the example 4-tube sketch provided in another thread that works for me. So I had to change the 0 through 10 pin numbers to 2 through 12 as noted by another post.

But the bigger problem is that the rest of the code is intended for 6 tubes, and quite a lot has to be modified to get it to work with a 4 tube setup. I have it working at least in terms of counting at the moment, but somehow I have managed to break the fading effect which is the whole point of the sketch!

I'll hopefully get it working and will report back with the modified source.

// Set time based on offset.. // long hbump = 60*60*clockHourSet; long hbump = 60*60*clockHourSet; long mbump = 60*clockMinSet; time += mbump + hbump;

// Convert time to days,hours,mins,seconds long days = time / DAYS; time -= days * DAYS; long hours = time / HOURS; time -= hours * HOURS; long minutes = time / MINS; time -= minutes * MINS; long seconds = time;

OK it turns out that the fade is working in my code, but I had used the same value of fadeStep (1.0) that Emblazed has in the code I started with, which makes for a too-fast fade with my board. Changing it to 0.4 gives a nice fade without overdoing it (0.3 is too much, or should I say too little).

I suspect that this value has to be tweaked depending on how hard you're driving your IN-17s; I have my anode voltage set to about 150V which is about as low as I can go before digits start fading a bit.

OK it turns out that the fade is working in my code, but I had used the same value of fadeStep (1.0) that Emblazed has in the code I started with, which makes for a too-fast fade with my board. Changing it to 0.4 gives a nice fade without overdoing it (0.3 is too much, or should I say too little).

I suspect that this value has to be tweaked depending on how hard you're driving your IN-17s; I have my anode voltage set to about 150V which is about as low as I can go before digits start fading a bit.

have fun,

Dave.

WWooooohooo! This is awesome code! Thank you so much for posting this! I have this on my personal unit on my desk at work and it's phenomenal! Great job!

// Set time based on offset.. // long hbump = 60*60*clockHourSet; long hbump = 60*60*clockHourSet; long mbump = 60*clockMinSet; time += mbump + hbump;

// Convert time to days,hours,mins,seconds long days = time / DAYS; time -= days * DAYS; long hours = time / HOURS; time -= hours * HOURS; long minutes = time / MINS; time -= minutes * MINS; long seconds = time;

// Set time based on offset.. // long hbump = 60*60*clockHourSet; long hbump = 60*60*clockHourSet; long mbump = 60*clockMinSet; time += mbump + hbump;

// Convert time to days,hours,mins,seconds long days = time / DAYS; time -= days * DAYS; long hours = time / HOURS; time -= hours * HOURS; long minutes = time / MINS; time -= minutes * MINS; long seconds = time;

// Get time in seconds. long time = (runTime) / 1000; //////////change this value to speed up or slow down the clock

// Set time based on offset.. // long hbump = 60*60*clockHourSet; long hbump = 60*60*clockHourSet; long mbump = 60*clockMinSet; time += mbump + hbump;

// Convert time to days,hours,mins,seconds long days = time / DAYS; time -= days * DAYS; long hours = time / HOURS; time -= hours * HOURS; long minutes = time / MINS; time -= minutes * MINS; long seconds = time;

// Get time in seconds. long time = (runTime) / 1000; //////////change this value to speed up or slow down the clock

// Set time based on offset.. // long hbump = 60*60*clockHourSet; long hbump = 60*60*clockHourSet; long mbump = 60*clockMinSet; time += mbump + hbump;

// Convert time to days,hours,mins,seconds long days = time / DAYS; time -= days * DAYS; long hours = time / HOURS; time -= hours * HOURS; long minutes = time / MINS; time -= minutes * MINS; long seconds = time;