Hi everyone,
I’m quite new to this environment and today i tried to use a 1 digit segment display with a SN74HC595N module(I use an Arduino mega2560), here’s the code:
#include <Arduino.h>
int pinDT = 7;
int pinLTC = 6;
int pinCLK = 5;
byte letters[3] = { B11101101, B11101000, B11000001};
int c = 0;
void scrollLetter(int c) {
digitalWrite(pinLTC, LOW);
shiftOut(pinDT, pinCLK, LSBFIRST, letters[c]);
digitalWrite(pinLTC, HIGH);
}
void setup() {
for (int i = 5; i < 8; i++){
pinMode(i, OUTPUT);
}
}
void loop() {
scrollLetter(c);
delay(1000);
if (c < 3)
c++;
else
c = 0;
}
Any suggestions are appreciated, thanks in advance.