Pages: [1]   Go Down
Author Topic: SPI Led module Question  (Read 933 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

I have bought a SPI Led Module , find attached the link:
http://www.dfrobot.com/wiki/index.php?title=SPI_LED_Module_(SKU:DFR0090)

I test the sketch and it works , but is it possible to run one LED unit ??
Now all LED segments units are showing the same numbers ( Loop)

All is working with the 74HC595 ( 8x / led segment unit ) 

I hope it's possible to do this ?

Regards ,

ArduinoPat
« Last Edit: January 25, 2013, 10:20:15 am by ArduinoPat » Logged

Patrick ,The Netherlands

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 641
Posts: 50361
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I test the sketch and it works , but is it possible to run one LED unit ??
Now all LED segments units are showing the same numbers ( Loop)
Do you mean each group of LED segments is showing the same value? And, that you want to use the unit to display "12345678" instead.

If that is what you mean, then, yes it should be possible. There is even code on that page to do it.
Logged

Netherlands
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello PaulS,

Now all displays ( 8 x 7segment leds display ) shows the count up or down.
But i mean , is this also possible to bring 7 segments "out of service "  and only one 7segment led display will show the count UP or down.



I hope you understand my question ,

Many thanks,

Regards

ArduinoPat
Logged

Patrick ,The Netherlands

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 641
Posts: 50361
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
is this also possible to bring 7 segments "out of service "  and only one 7segment led display will show the count UP or down.
Yes. If you send no data to 7 of the 7-segment displays, they should remain off. Only the data sent to the 8th one should cause the 8th one to light up.
Logged

Netherlands
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi PaulS,

Now my next question,
How to bring these 7 segment LED ( 7 pc ) out of service and one still working ??

All these 74hc595 are coupled like a BUS ??? ( am i right ?? )

Maybe you can help to put me at the right direction,

I have tryed to find this at the sketch but there are no such kind of parameters regarding this ?

Code:
//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 8;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 3;
////Pin connected to Data in (DS) of 74HC595
const int dataPin = 9;
byte Tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};
void setup() {
  //set pins to output because they are addressed in the main loop
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT); 
  pinMode(clockPin, OUTPUT);
  Serial.begin(9600);
  Serial.println("reset");
}
void loop() {
  if (Serial.available() > 0) {
    // ASCII '0' through '9' characters are
    // represented by the values 48 through 57.
    // so if the user types a number from 0 through 9 in ASCII,
    // you can subtract 48 to get the actual value:
  int bitToSet = Serial.read() - 48;
  // write to the shift register with the correct bit set high:
  digitalWrite(latchPin, LOW);
  // shift the bits out:
  shiftOut(dataPin, clockPin, MSBFIRST, Tab[bitToSet]);
    // turn on the output so the LEDs can light up:
  digitalWrite(latchPin, HIGH);
  }
}


I hope you can support me about this,

Regards,

ArduinoPat
Logged

Patrick ,The Netherlands

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 641
Posts: 50361
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
How to bring these 7 segment LED ( 7 pc ) out of service and one still working ??
I don't know what you mean by "out of service". You can't have one working and 7 not working. You can have one displaying something and 7 displaying nothing. But, displaying nothing and out-of-service are not the same thing at all.

Logged

Netherlands
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello PaulS,


Sorry for indistinct , but this is my question :

Quote
You can have one displaying something and 7 displaying nothing

Regards ,

ArduinoPat
Logged

Patrick ,The Netherlands

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 641
Posts: 50361
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First, what does the code you posted earlier do? If you send 6 to the serial port, what happens? What happens when you send 3 to the serial port?
Logged

Netherlands
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When i start the sketch , the displays ( 8x ) are empty
I Open the Terminal and type 1 , the first 7segment is active now
when type two in the terminal , two appears at the first 7 segment , one is appeared at second 7 segement digit,

and this will go on till all (smiley-cool 7 segement displays are filled with a number.


Regards,

ArduinoPat
Logged

Patrick ,The Netherlands

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 27363
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like you need to send 8 characters every time:

7 space space space space space space space Enter
or
space space space space space space space 7 Enter
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but is it possible to run one LED unit ??

This looks like a daisy-chained spi module: each digit has its own serial shifters and they are not multiplexed.

So to update,  you send 8 bytes and then latch. You will need to find out if the left most digit is the 1st byte or the last byte.

Once you have that, you can simply send "space" to the digits you do not want to turn on and then send the segment information to the digit(s) you do want to turn on.

The ultimate flexibility.
Logged

Pages: [1]   Go Up
Jump to: