0.1.2 - Silence the shift register on boot.

master
Jay 4 years ago
parent e5798d8e91
commit 3136e0d30c

@ -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.
````

@ -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() {

Loading…
Cancel
Save