Digital dashboard with TM1638 and Arduino Nano v3

Dashboard, gauge projects etc.
Please use the image gallery for your pictures, a short tutorial can be found here.
The first image in the first post will be shown in the project gallery.

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby juanchiooo » Mon 3. Dec 2012, 13:15

included the code underneath the video ...
sketch_dec03b: 3: error: stray '\' in program
sketch_dec03b: 3: error: stray '\' in program
sketch_dec03b: 3: error: stray '\' in program
sketch_dec03b: 3: error: stray '#' in program
sketch_dec03b: 1: error: expected unqualified-id before '/' token


help please, thanks
juanchiooo
 
Posts: 3
Joined: Sat 17. Nov 2012, 14:26
Has thanked: 0 time
Been thanked: 0 time

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby prodigy » Tue 25. Dec 2012, 12:13

I've ordered the two component for dashboard and while I'm waiting I just want to check if this is the proper wiring for Tronic's code.

Code: Select all
// define a module on data pin 5, clock pin 4 and strobe pin 3


And how do I include the TM1638.h file? Donwload it and put it in same folder where *.ino file with Tronic's source code is?

It's impressive how Leo Bodnar's SLI-PRO dashboard cost's 160 $ and this version cost less than 20 $ doing almost the same thing, except for button connections.. Nice find Tronic! 8-)
Attachments
Last edited by prodigy on Tue 25. Dec 2012, 13:51, edited 1 time in total.
User avatar
prodigy
X-Sim Supporter
 
Posts: 274
Images: 42
Joined: Tue 16. Oct 2012, 12:32
Location: Pula, Croatia
Has thanked: 20 times
Been thanked: 21 times

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby vicpopo » Tue 25. Dec 2012, 13:32

Hi Prodigy ,

For wiring I think you are right . Just test after compiling the programm.When you download the library on the internet page it given where to put it.It's into library arduino program I believe.
It's quiet easy !!
I just had problem when compiling the program because I didn't choose the right arduino module in the list that the program was proposing.After this littl mistake everthing had perfectly worked.
Best Regards
User avatar
vicpopo
 
Posts: 645
Joined: Fri 20. Apr 2012, 18:04
Location: Strasbourg France
Has thanked: 39 times
Been thanked: 79 times

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby Szczena » Mon 21. Jan 2013, 23:44

Welcome.Could someone insert your code using these buttons as it is shown in the video tronicgr ?
Szczena
 
Posts: 1
Joined: Fri 13. Apr 2012, 19:09
Has thanked: 0 time
Been thanked: 0 time

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby prodigy » Thu 24. Jan 2013, 16:12

I have received the dashboard today and successfully tested it, everything went fine and it is working in game too. Thanks to Tronic for this super cheap solution. Thanks to Vicpopo for KMH speed tip.

I have only one small problem, the colors of LED for RPM are inverted, first 5 leds are red color and last 3 are green. It should be other way around, like on the videos in the first page.

How can I correct this?
User avatar
prodigy
X-Sim Supporter
 
Posts: 274
Images: 42
Joined: Tue 16. Oct 2012, 12:32
Location: Pula, Croatia
Has thanked: 20 times
Been thanked: 21 times

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby dearn » Thu 24. Jan 2013, 17:08

I finished my dashboard with the TM1638. I will post all pictures while making it soon in my project page.

(i had to resolder the connectors on the back of the TM1638) :roll:

1091
http://www.ArcadeWinkel.nl | Arcade spare parts and kits
User avatar
dearn
X-Sim Stage 2 edition
 
Posts: 66
Images: 139
Joined: Mon 23. Jul 2012, 12:16
Location: Netherlands
Has thanked: 1 time
Been thanked: 3 times

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby tronicgr » Thu 24. Jan 2013, 19:20

prodigy wrote:
I have only one small problem, the colors of LED for RPM are inverted, first 5 leds are red color and last 3 are green. It should be other way around, like on the videos in the first page.

How can I correct this?


Simply, invert the bits (from 0 to 1 and from 1 to 0) in the code in the part that you send the LED commands...


Thanos
User avatar
tronicgr
 
Posts: 624
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 130 times
Been thanked: 49 times

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby prodigy » Thu 24. Jan 2013, 21:16

Thank you very much Tronic!

I saw on my display board that it is V1.2, and in your videos it is V1.1. Maybe that's why there was the difference.

If anyone runs into the same problem, here is the last part of the code for RPM leds:
Code: Select all
   
if (rpmdata == 1) {
       
       rpmleds = map(rpm,0,rpmmax,0,9);    // distributes the rpm level to the 8 leds + 1 for shift change
       if (rpmleds==0){
         module.setLEDs(0b00000000 | 0b00000000<< 8);
       }
       if (rpmleds==1){
         module.setLEDs(0b00000001 | 0b00000000<< 8 );
       }
       if (rpmleds==2){
         module.setLEDs(0b00000011 | 0b00000000<< 8 );
       }
       if (rpmleds==3){
         module.setLEDs(0b00000111 | 0b00000000<< 8 );
       }
       if (rpmleds==4){
         module.setLEDs(0b00001111 | 0b00000000<< 8);
       }
       if (rpmleds==5){
         module.setLEDs(0b00011111 | 0b00000000<< 8);
       }
       if (rpmleds==6){
         module.setLEDs(0b00011111 | 0b00100000<< 8 );
       }
       if (rpmleds==7){
         module.setLEDs(0b00011111 | 0b01100000<< 8 );
       }
       if (rpmleds==8){
         //module.setLEDs(0b11100000 | 0b000011111<< 8 );}
         module.setLEDs(0b11111111 | 0b111111111<< 8 );
       }
       rpmdata=0;
    }
    }


I had to change this part as well to synchronize LEDs with game
Code: Select all
rpmmax = (rpmmax * 100)+1500;

Before it was +500, but the red leds for gear shifting were appearing to soon.
I don't know if that was the proper way to fix it, but it worked. :roll:

And great box Dearn, I will need to do something similar myself with carbon tape. I was already considering that I'll need to resolder the wires, I see now it is a must :)
User avatar
prodigy
X-Sim Supporter
 
Posts: 274
Images: 42
Joined: Tue 16. Oct 2012, 12:32
Location: Pula, Croatia
Has thanked: 20 times
Been thanked: 21 times

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby vicpopo » Thu 24. Jan 2013, 21:45

Hi Prodigy,

Thanks for sharing.If it works for you for leds and you like it then that's funny!
Personaly I 'm playing with the code and Thanos help for displaying the gear on a big 7 segments display (57 mm high) and the tm1638 for speed ,rpm and leds gear indicator.
Best Regards
User avatar
vicpopo
 
Posts: 645
Joined: Fri 20. Apr 2012, 18:04
Location: Strasbourg France
Has thanked: 39 times
Been thanked: 79 times

Re: Digital dashboard with TM1638 and Arduino Nano v3

Postby prodigy » Fri 25. Jan 2013, 18:32

Today I was playing a bit more with dashboard and I have one more question, just to make sure if I did something wrong or is it normally to be like that. So, I played LFS yesterday with the Formula car like in Tronics video and everything is OK, LEDs are well synchronized. But when I switch to smaller car with lower RPM, the LEDs are not synchronized anymore, they can't go to max limit or all red leds for gear switch.

Is it normal to be so?

I can correct this by either changing the math values for RPM for example from 65535 to 50535, depends on the car. Or either changing the rpmmax = (rpmmax * 100)+1500; line in the Arduino code. But I will need to do that for every car cause they all have different RPMs.

I guess when new version of X-Sim with auto-adjusting feature come out, those car changes won't be necessary anymore.
User avatar
prodigy
X-Sim Supporter
 
Posts: 274
Images: 42
Joined: Tue 16. Oct 2012, 12:32
Location: Pula, Croatia
Has thanked: 20 times
Been thanked: 21 times

PreviousNext

Return to Peripheral Projects

Who is online

Users browsing this forum: No registered users and 2 guests