Go Down

Topic: how do I code this led display driver? (Read 417 times) previous topic - next topic

Stigan

How do I write the code to manage this led display driver?

I want it to display numbers..not strange patterns:)

In the datasheet they describe how to send the data, its just far more advanced to code that than im capable;

www.datasheetcatalog.org/datasheet/SGSThomsonMicroelectronics/mXqqv.pdf


Here is the code i use for making it blink in strange patterns:

thanks

/* Shift Out Data
* --------------
*
* Shows a byte, stored in "dato" on a set of 8 LEDs
*
* (copyleft) 2005 K3, Malmo University
* @author: David Cuartielles, Marcus Hannerstig
* @hardware: David Cuartielles, Marcos Yarza
* @project: made for SMEE - Experiential Vehicles
*/


int data = 3;
int strob = 8;
int clock = 4;
int oe = 11;
int count = 0;
int dato = 0;

void setup()
{
beginSerial(9600);
pinMode(data, OUTPUT);
pinMode(clock, OUTPUT);
pinMode(strob, OUTPUT);
pinMode(oe, OUTPUT);
}

void PulseClock(void) {
  digitalWrite(clock, LOW);
  delayMicroseconds(20);
  digitalWrite(clock, HIGH);
  delayMicroseconds(50);
  digitalWrite(clock, LOW);
}

void loop()
{
 dato = 254;
 for (count = 0; count < 8; count++) {
  digitalWrite(data, dato & 01);
  //serialWrite((dato & 01) + 48);
  dato>>=1;
  if (count == 7){
  digitalWrite(oe, LOW);
  digitalWrite(strob, HIGH);

  }
  PulseClock();
   digitalWrite(oe, HIGH);
}

delayMicroseconds(20);
digitalWrite(strob, LOW);
delay(100);


serialWrite(10);
serialWrite(13);
delay(100);                  // waits for a moment
}

Go Up