|
@@ -32,14 +32,12 @@ void programMode() {
|
|
dbgOut("Adr:");
|
|
dbgOut("Adr:");
|
|
dbgOutLn(addr);
|
|
dbgOutLn(addr);
|
|
// LoNibble Adresse anzeigen
|
|
// LoNibble Adresse anzeigen
|
|
- doPort(addr);
|
|
|
|
- delay(SHOW_DELAY);
|
|
|
|
|
|
+ doDimPort(addr);
|
|
|
|
|
|
blinkD2();
|
|
blinkD2();
|
|
// HiNibble Adresse anzeigen
|
|
// HiNibble Adresse anzeigen
|
|
data = (addr & 0xf0) >> 4; //Adresse anzeigen
|
|
data = (addr & 0xf0) >> 4; //Adresse anzeigen
|
|
- doPort(data);
|
|
|
|
- delay(SHOW_DELAY);
|
|
|
|
|
|
+ doDimPort(data);
|
|
|
|
|
|
byte Eebyte = EEPROM.read(addr);
|
|
byte Eebyte = EEPROM.read(addr);
|
|
data = Eebyte & 15;
|
|
data = Eebyte & 15;
|
|
@@ -76,7 +74,7 @@ void programMode() {
|
|
}
|
|
}
|
|
while (digitalRead(SW_PRG) == 1); // S2 = 1
|
|
while (digitalRead(SW_PRG) == 1); // S2 = 1
|
|
delay(DEBOUNCE);
|
|
delay(DEBOUNCE);
|
|
-
|
|
|
|
|
|
+
|
|
byte newValue = (com << 4) + data;
|
|
byte newValue = (com << 4) + data;
|
|
if (newValue != Eebyte) {
|
|
if (newValue != Eebyte) {
|
|
EEPROM.write(addr, newValue); // Writeeeprom Eebyte , Addr
|
|
EEPROM.write(addr, newValue); // Writeeeprom Eebyte , Addr
|
|
@@ -128,3 +126,30 @@ void blinkNull() {
|
|
doPort(0x00);
|
|
doPort(0x00);
|
|
delay(BLINK_DELAY);
|
|
delay(BLINK_DELAY);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+void doDimPort(byte data) {
|
|
|
|
+ long value = millis() + SHOW_DELAY;
|
|
|
|
+ do {
|
|
|
|
+ // on part
|
|
|
|
+ digitalWrite(Dout_0, 1);
|
|
|
|
+ digitalWrite(Dout_1, 1);
|
|
|
|
+ digitalWrite(Dout_2, 1);
|
|
|
|
+ digitalWrite(Dout_3, 1);
|
|
|
|
+ delay(5);
|
|
|
|
+
|
|
|
|
+ // off part
|
|
|
|
+ if ((data & 0x01) == 0) {
|
|
|
|
+ digitalWrite(Dout_0, 0);
|
|
|
|
+ }
|
|
|
|
+ if ((data & 0x02) == 0) {
|
|
|
|
+ digitalWrite(Dout_1, 0);
|
|
|
|
+ }
|
|
|
|
+ if ((data & 0x04) == 0) {
|
|
|
|
+ digitalWrite(Dout_2, 0);
|
|
|
|
+ }
|
|
|
|
+ if ((data & 0x08) == 0) {
|
|
|
|
+ digitalWrite(Dout_3, 0);
|
|
|
|
+ }
|
|
|
|
+ delay(5);
|
|
|
|
+ } while (value < millis());
|
|
|
|
+}
|