Simulationsprogramm für ein DCF77 Signal
Das Programm dient zum Test, ob ein DCF77 Signal von einer Software erkannt wird.
This commit is contained in:
commit
c65ef38b9c
64
DCF77_Simulator.ino
Normal file
64
DCF77_Simulator.ino
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
Das Programm gibt eine Bitfolge aus, die ein DCF 77 Signal simuliert
|
||||
Es sind genau 59 Bit, die nach einer kurzen Pause wiederholt werden
|
||||
Die simulierte Zeit ist 17.03 Uhr
|
||||
0-00011110001110-001001-11000000-1110100-011000-111-00001-001001000
|
||||
*/
|
||||
|
||||
|
||||
#define outPin 16 // D0
|
||||
byte selectBit;
|
||||
|
||||
int timeBit[59] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 2};
|
||||
|
||||
void setup() {
|
||||
pinMode(outPin, OUTPUT);
|
||||
digitalWrite(outPin, LOW);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
for (int i = 0; i <= 58; i++) {
|
||||
int a = timeBit[i];
|
||||
if (a == 0) {
|
||||
selectBit = 0;
|
||||
}
|
||||
if (a == 1) {
|
||||
selectBit = 1;
|
||||
}
|
||||
if (a == 2) {
|
||||
selectBit = 2;
|
||||
}
|
||||
|
||||
switch (selectBit) {
|
||||
case 0:
|
||||
digitalWrite(outPin, HIGH);
|
||||
delay(100);
|
||||
digitalWrite(outPin, LOW);
|
||||
delay(900);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
digitalWrite(outPin, HIGH);
|
||||
delay(200);
|
||||
digitalWrite(outPin, LOW);
|
||||
delay(800);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
digitalWrite(outPin, HIGH);
|
||||
delay(100);
|
||||
digitalWrite(outPin, LOW);
|
||||
delay(1900);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
digitalWrite(outPin, HIGH);
|
||||
delay(200);
|
||||
digitalWrite(outPin, LOW);
|
||||
delay(1800);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user