static int total_samples = 0;
static int high_samples = 0;
- if (total_samples >= 1000) {
- if (high_samples > 500) {
+ // read from the WWVB receiver, with some hysteresis
+ if (total_samples >= 100) {
+ if (high_samples > 20) {
signal = HIGH;
}
else {
}
}
+ // has the timer ticked?
unsigned long m = millis();
if (m != previous_millis) {
millisecond += (m - previous_millis);
previous_millis = m;
int pulse_length;
- //int signal = digitalRead(wwvb); // is the input high or low right now?
if (signal) {
- analogWrite(timecodeled, 10); // it's too bright on my board so we dim it; change to digitalWrite() if not needed
+ analogWrite(timecodeled, 5); // it's too bright on my board so we dim it; change to digitalWrite() if not needed
}
else {
digitalWrite(timecodeled, LOW);