Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15652

Sevent segments hc595 problem

$
0
0

Hello, I need a little help since I have a problem with my project using three shift registers hc595 and three 7-segment displays.

My problem is that I load my board with a counter program from 0 to 999 and the program works, the problem is that when it displays the digits I get small, very faint blinks on my counter and I need them to be gone. Has anyone had a similar problem? I attach my code and photo of the displays.

 #define SER A0    //data
 #define RCLK PE1  // LATCH
 #define SRCLK A1  //            CLOCK
 #define Btn A6

uint8_t display[] = { B11111001, B11000000, B10110101, B11100101, B11001100, B01101101, B01111101, B11000001, B11111101, B11001101 };
unsigned long tiempoAnterior = 0;
void setup() {
  pinMode(SER, OUTPUT);
  pinMode(RCLK, OUTPUT);
  pinMode(SRCLK, OUTPUT);
  shiftOut(SER, SRCLK, MSBFIRST, display[0]);
  shiftOut(SER, SRCLK, MSBFIRST, display[0]);
  shiftOut(SER, SRCLK, MSBFIRST, display[0]);
  digitalWrite(RCLK, LOW);
  digitalWrite(RCLK, HIGH);
void loop() {
  tiempoActual = millis();
  if ((tiempoActual - tiempoAnterior) > 100) {
    carga(i, j, k);
    i++;
    if (i > 9) {
      i = 0;
      j++;
    }
    if (j > 9) {
      j = 0;
      k++;
      if (k > 9) {
        i = 0;
        j = 0;
        k = 0;
      }
    }
    tiempoAnterior = millis();
  }
}
int carga(int digito1, int digito2, int digito3) {
  digitalWrite(RCLK, LOW);
  shiftOut(SER, SRCLK, MSBFIRST, display[i]);
  digitalWrite(RCLK, HIGH);
  digitalWrite(RCLK, LOW);
  shiftOut(SER, SRCLK, MSBFIRST, display[j]);
  digitalWrite(RCLK, HIGH);
  digitalWrite(RCLK, LOW);
  shiftOut(SER, SRCLK, MSBFIRST, display[k]);
  digitalWrite(RCLK, HIGH);
  // delay(50);
  

  
}

im kind of new so i apologize for any mistake.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 15652

Latest Images

Trending Articles



Latest Images