add const for LED pin, remove unneccessary toggle

This commit is contained in:
Silentium 2019-05-25 17:57:45 +02:00
parent 95ba264315
commit d77f482ff0

View file

@ -18,6 +18,7 @@ int const WIDTH = 120;
int const LINES = 7; int const LINES = 7;
int const CHAR_GAP = 1; int const CHAR_GAP = 1;
int const LINE_PINS[7] = { 2, 3, 4, 5, 6, 7, 8 }; int const LINE_PINS[7] = { 2, 3, 4, 5, 6, 7, 8 };
int const LED_PIN = 13;
uint8_t buffer[120]; uint8_t buffer[120];
String message = "Infodesk #GPN19"; String message = "Infodesk #GPN19";
@ -118,7 +119,7 @@ void setup() {
for (uint_fast8_t i = 2; i <= 10; ++i) { for (uint_fast8_t i = 2; i <= 10; ++i) {
pinMode(i, OUTPUT); pinMode(i, OUTPUT);
} }
pinMode(13, OUTPUT); pinMode(LED_PIN, OUTPUT);
Serial.begin(9600); Serial.begin(9600);
} }
@ -130,10 +131,8 @@ void loop() {
shiftout(bit); shiftout(bit);
} }
digitalWrite(13, 1);
digitalWrite(LINE_PINS[y], 1); digitalWrite(LINE_PINS[y], 1);
delayMicroseconds(200); delayMicroseconds(200);
digitalWrite(13, 0);
digitalWrite(LINE_PINS[y], 0); digitalWrite(LINE_PINS[y], 0);
} }