You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int displayLast[6]={11,11,11,11,11,11}; //What is currently being displayed. We slowly fade away from this.
996
-
float displayNextFade[6]={0.0f,0.0f,0.0f,0.0f,0.0f,0.0f}; //Fading in displayNext values
997
-
float displayLastFade[6]={8.0f,8.0f,8.0f,8.0f,8.0f,8.0f}; //Fading out displayLast values
998
-
unsignedlong setStartLast = 0; //to control flashing
994
+
995
+
//ms
996
+
/*
997
+
------ ------ ------
998
+
full transition, let's say is 200ms
999
+
transition start is 10000ms
1000
+
cycle = 6 (normal) or 3 (dim)
1001
+
mils diff at 1st cycle is 0; nextDur = ((diff*(6-1))/200)+1 = 1; lastDur = (6-nextDur) = 5;
1002
+
mils diff at 2nd cycle is 10; nextDur = 1....
1003
+
3rd - 20
1004
+
4th - 30
1005
+
5th - 40; nextDur = 2.... lastDur = 4......
1006
+
1007
+
1st - 0 - /0!!!!!!!!
1008
+
1009
+
at 6ms per digit, 1ms change each time, 3 pairs of digits = 75ms transition.
1010
+
=====- =====- =====-
1011
+
====-- ====-- ====--
1012
+
===--- ===--- ===---
1013
+
==---- ==---- ==----
1014
+
=----- =----- =-----
1015
+
at 4ms per digit, 4x4x3 = 48ms
1016
+
at 3ms per digit, 3x3x3 = 27ms
1017
+
at 6ms 6x6x3 = 108ms
1018
+
*/
1019
+
constchar fadeDur = 6; //each multiplexed pair of digits appears for this amount of time: partly next digit, partly last digit, partly dim (if applicable)
1020
+
constchar dimDur = 4; //half of fadeDur for half brightness? don't go over fadeDur-2
1021
+
char fadeNextDur = 0; //Fading in displayNext values --TODO put back at 0
1022
+
char fadeLastDur = 6; //Fading out displayLast values
1023
+
unsignedlong fadeStartLast = 0; //when the last digit fade was started
1024
+
byte cycleStage = 0; //Which stage of the multiplexing cycle we're in
1025
+
unsignedlong cycleLast = 0; //when the last stage was started
1026
+
char cycleDelay = 0; //how long until the next stage starts - set from fadeNextDur and fadeLastDur
1027
+
unsignedlong setStartLast = 0; //to control flashing during start
fadeNextDur = (((mils-fadeStartLast)*(fadeDur-(dim?dimDur:0)-1))/(readEEPROM(20,false)*10))+1; //partial based on time since fadeStatLast and EEPROM overall digit fade setting
if(fadeStartLast!=0) { //If we're working on fading
1147
+
fadeNextDur = ((mils-fadeStartLast*(fadeDur-(dim?dimDur:0)-1))/(readEEPROM(20,false)*10))+1; //partial based on time since fadeStatLast and EEPROM overall digit fade setting
elseif(fadeLastDur>0) { //if we've just shut off the display in the middle of a fade (does this ever happen?), set things up for when display comes back
1195
+
fadeLastDur = 0; //force a full fade in to the new value...
0 commit comments