Also ich habe so ein Modul hier und nicht die geringsten Probleme damit. Allerdings arbeite ich auch gerade an extra robustem Filtercode. Wäre jemand der große Störungen hat bereit mir Daten von so richtig kaputten Signalen zu schicken damit ich den Code testen und optimieren kann? Das Ergebnis stelle ich selbstverständlich der Allgemeinheit zur Verfügung.
//
// www.blinkenlight.net
//
// Copyright 2012 Udo Klein
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/
#include <MsTimer2.h>
const uint8_t monitor_pin = 13;
const uint8_t dcf77_sample_pin = 19; // A5
const uint8_t dcf77_analog_sample_pin = 5;
void sampler() {
const uint32_t input = analogRead(dcf77_analog_sample_pin)>200;
digitalWrite(monitor_pin, input);
Serial.print(input? "0": "1");
static uint16_t tick = 0;
if (++tick == 100) {
tick = 0;
Serial.println();
}
}
void setup() {
Serial.begin(115200);
pinMode(dcf77_sample_pin, INPUT);
digitalWrite(dcf77_sample_pin, HIGH);
pinMode(monitor_pin, OUTPUT);
MsTimer2::set(1, sampler);
MsTimer2::start();
}
void loop() { }
Gewünscht wäre der Output von 1 Stunde Datensammeln. 1 Tag wäre noch besser ![]()