diff --git a/README.md b/README.md index 25865bd..d4865c4 100644 --- a/README.md +++ b/README.md @@ -19,5 +19,6 @@ Schematics and pictures up later. 28-Dec-2019: Initial Version. Just reads five switches and triggers an output. 29-Dec-2019: Version 0.1 - Added a display. Cleaned up code. Made a repository. 29-Dec-2019: Version 0.1.1 - Added preliminary IR remote support +30-Dec-2019: Version 0.1.2 - Controls ShiftReset and OutputEnable on 595 to prevent random start-up state. ```` diff --git a/pma770.ino b/pma770.ino index d02a93f..f7690a9 100644 --- a/pma770.ino +++ b/pma770.ino @@ -12,7 +12,9 @@ int latchPin = 11; int clockPin = 9; int dataPin = 12; +int srReset = 6; int IRin = 7; +int srEnable = 5; int matrix = A0; byte out = 0; @@ -24,7 +26,7 @@ LiquidCrystal_I2C lcd(0x27,16,2); void updateShiftRegister() { - digitalWrite(latchPin,LOW); + digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, LSBFIRST, out); digitalWrite(latchPin, HIGH); } @@ -97,6 +99,9 @@ void setup() pinMode(latchPin, OUTPUT); pinMode(dataPin, OUTPUT); pinMode(clockPin, OUTPUT); + pinMode(srReset, OUTPUT); + pinMode(srEnable, OUTPUT); + digitalWrite(srReset,HIGH); remote.enableIRIn(); bitSet(out,5); lcd.init(); @@ -107,7 +112,7 @@ void setup() lcd.setCursor(0, 1); lcd.print("Input: AUX"); updateShiftRegister(); - + digitalWrite(srEnable,LOW); } void loop() {