TM1638 how to move digits.

Hi Guys

I am new to the forum and very much a newbie. I have learnt a lot from watching various videos.

I was hoping I could get some help with the TM1638

If possible I would like to display 2 different scores (2 digits numbers) on one display.

I can get it to display 1 score in the right corner but have no idea how to move the score to the left.

For example

int score = 99;

module.setDisplayToDecNumber(score,0,false);

This works fine for displaying 99 in the right corner but would it be possible to do the following and any ideas how its done.

This contaiins a text string "Sc" and 2 variables that will do up to 99

This is how I want it to look

[Sc 99:99]

Sc is a text string and the two 99's are variables that starts at 0 and will go up to a maximum of 99.

Sorry if this is a stupid question I am just learning.

Cheers for any help.

Mike

mikehanson:
Hi Guys

I am new to the forum and very much a newbie. I have learnt a lot from watching various videos.

I was hoping I could get some help with the TM1638

If possible I would like to display 2 different scores (2 digits numbers) on one display.

I can get it to display 1 score in the right corner but have no idea how to move the score to the left.

For example

int score = 99;

module.setDisplayToDecNumber(score,0,false);

This works fine for displaying 99 in the right corner but would it be possible to do the following and any ideas how its done.

This contaiins a text string "Sc" and 2 variables that will do up to 99

This is how I want it to look

[Sc 99:99]

Sc is a text string and the two 99's are variables that starts at 0 and will go up to a maximum of 99.

Sorry if this is a stupid question I am just learning.

Cheers for any help.

Mike

Look at the below links:

Using a TM1638 based board with Arduino

Arduino and TM1638 LED Display Modules

TM1638 Scrolling text on Arduino

Thank you for taking the time to reply.

I really appreciate your help.

Unfortunatly after many hours of studying these websites I still have no idea how to do it or even if it is possible.

The first website shows digits in 2 different places but is way over my head as it doesnt use the tm1638 libary and the code makes no sence at all to me and i wouldn't know how to edit it to my needs.

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xc0); // 1st digit
shiftOut(data, clock, LSBFIRST, 0xff);
digitalWrite(strobe, HIGH);

digitalWrite(strobe, LOW);
shiftOut(data, clock, LSBFIRST, 0xce); // last digit
shiftOut(data, clock, LSBFIRST, 0xff);
digitalWrite(strobe, HIGH);

The other 2 sites I do understand but dont show me what I need.

If anyone can help further It would be very much appreciated.

Cheers Mike.

Please go to the second of the three links posted by artisticforge.

On the page at that link, there is a demonstration which uses code like this:

byte values[] = { 1, 2, 4, 8, 16, 32, 64, 128 };

or this:

byte values[] = { 99,99,99,99,99,99,99,99 };

together with this:

module.setDisplay(values);

Please go to that page and look again at that demonstration. I believe that that is at the heart of what you need.

Do you know how to use arrays? You will need to know how to use arrays in order to get good use out of this.

Thank you so much for putting me on the right track.

I have now re-read the article. and i am at least getting somewhere now thank you very much.

I can at least now display what I want using these 2 pieces of code.

byte values[] = { 109,88,72,63,63,64,63,63 };

module.setDisplay(values);

This displays Sc=00-00

Which is what i want to at least start with.

I just now need to learn how to get the 00 values to change. (well match the variables)

But that is something I need to learn.

No I have not had much experience with arrays. I will do some learning about arrays.

This is great fun.

Thank you for your help

Cheers Mike

odometer:
Please go to the second of the three links posted by artisticforge.

On the page at that link, there is a demonstration which uses code like this:

byte values[] = { 1, 2, 4, 8, 16, 32, 64, 128 };

or this:

byte values[] = { 99,99,99,99,99,99,99,99 };

together with this:

module.setDisplay(values);

Please go to that page and look again at that demonstration. I believe that that is at the heart of what you need.

Do you know how to use arrays? You will need to know how to use arrays in order to get good use out of this.

thank you.
I was ready to reach for my clue stick to instill some clues.