Ty,
You asked about firmware changes. Just a few small adjustments, changing the default choice for MM-DD-YY, backlight option, etc. Also changed the default time provider.
A couple of things may be of interest.
in the Firmware Firmware V2 Classic Rev6 Code, V356,
Function
// ************************************************************
// Set the seconds tick led(s) and the back lights
// ************************************************************
void setLeds()
Changed: (at about line 987)
// Tick led output
analogWrite(tickLed, getLEDAdjusted(255, pwmFactor, dimFactor));
to:
// Tick led output
//flash the separators once per second
if (secsDelta <50 || secsDelta > 950) {
analogWrite(tickLed, 175);
} else {
analogWrite(tickLed, 0);
}
//analogWrite(tickLed, getLEDAdjusted(255, pwmFactor, dimFactor));
This gives a nice bright flash at the top of each second, then the tick neons go blank. It appears to the eye as if the ticks flash, and then the numbers change.
Directly after those lines I added:
// ************************************************************
// change backlight options per every six seconds
// ************************************************************
if ((second() >= 0) && (second() < 6)){
backlightMode = BACKLIGHT_FIXED;
markersecond9 = true;
if (markersecond0) {
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond0 = false;
}
}
if ((second() >= 7) && (second() < 12)){
backlightMode = BACKLIGHT_PULSE;
markersecond0 = true;
if (markersecond1){
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond1 = false;
}
}
if ((second() >= 13) && (second() < 18)){
backlightMode = BACKLIGHT_CYCLE;
markersecond1 = true;
if (markersecond2){
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond2 = false;
}
}
if ((second() >= 19) && (second() < 24)){
backlightMode = BACKLIGHT_COLOUR_TIME;
markersecond2 = true;
if (markersecond3){
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond3 = false;
}
}
if ((second() >= 25) && (second() < 30)){
backlightMode = BACKLIGHT_FIXED_DIM;
markersecond3 = true;
if (markersecond4){
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond4 = false;
}
}
if ((second() >= 31) && (second() < 36)){
backlightMode = BACKLIGHT_PULSE_DIM;
markersecond4 = true;
if (markersecond5){
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond5 = false;
}
}
if ((second() >= 37) && (second() < 42)){
backlightMode = BACKLIGHT_CYCLE_DIM;
markersecond5 = true;
if (markersecond6){
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond6 = false;
}
}
if ((second() >= 43) && (second() < 48)){
backlightMode = BACKLIGHT_COLOUR_TIME_DIM;
markersecond6 = true;
if (markersecond7){
markersecond7 = false;
}
}
if ((second() >= 49) && (second() < 54)){
backlightMode = BACKLIGHT_CYCLE;
markersecond7 = true;
if (markersecond8){
markersecond8 = false;
}
}
if ((second() >= 55) && (second() < 60)){
backlightMode = BACKLIGHT_FIXED;
markersecond8 = true;
if (markersecond9){
redCnl=random(5, 15);
grnCnl=random(5, 15);
bluCnl=random(5, 15);
markersecond9 = false;
}
}
These variables must be declared:
bool markersecond0 = true;
bool markersecond1 = true;
bool markersecond2 = true;
bool markersecond3 = true;
bool markersecond4 = true;
bool markersecond5 = true;
bool markersecond6 = true;
bool markersecond7 = true;
bool markersecond8 = true;
bool markersecond9 = true;
bool colourmarker = true;
bool colourmarkerd = true;
This causes the back light option to change behavior every six seconds, and makes for a very jumpy clock. However, I think this may be useful for demonstration purposes.
Finally, I was getting the decimal point at the 10's minutes position lighting up.
In this section: // ************************************************************
// Check the PIR status. If we don't have a PIR installed, we
// don't want to respect the pin value, because it would defeat
// normal day blanking. The first time the PIR takes the pin low
// we mark that we have a PIR and we should start to respect
// the sensor.
// Returns true if PIR sensor is installed and we are blanked
// ************************************************************
boolean checkPIR(unsigned long nowMillis) {
boolean pirvalue = (digitalRead(pirPin) == HIGH);
boolean useDPs = (dpEnable == DP_ENABLE_ALL);
dpArray[5] = pirvalue && useDPs;
if (pirvalue) {
pirLastSeen = nowMillis;
return false;
} else {
if (nowMillis > (pirLastSeen + (pirTimeout * 1000))) {
dpArray[5] = false;
return true;
} else {
dpArray[5] = true && useDPs;
return false;
}
}
}
The last [5] references had been [4] in the most recent firmware. Was that a typo?
Anyway, thanks for all your help.
Tim