Building an outdoor scoreboard..

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Disc0nect0r
Posts: 3
Joined: Tue Mar 07, 2017 10:33 pm

Re: Building an outdoor scoreboard..

Post by Disc0nect0r » Sun Apr 09, 2017 11:07 pm

Legend :) , Great code there, @mickot did you create your own font for the large numbers ? am currently playing with it as we speak making a few changes like having another DMD for team names near the score permanently

mickot
Posts: 6
Joined: Sun Mar 23, 2014 12:01 pm

Re: Building an outdoor scoreboard..

Post by mickot » Mon Apr 10, 2017 7:18 pm

Standing on the shoulders of giants - I used Joe's spreadsheet to create the font.
Posted it here if you are interested.

Of course, I would re-factor the code if I had to do it again and might even use a Linkit Smart Duo MT7688 as the front end, cheaper than a Yun and can be easily adapted for an external antenna. It is compatible with Arduino Yun sketches and cheap as chips.

https://www.seeedstudio.com/LinkIt-Smar ... -2574.html

-micko
ScoreboardFont.h
(4.54 KiB) Downloaded 25 times

fiqrialdihardiyan
Posts: 1
Joined: Wed May 17, 2017 1:47 am

Re: Building an outdoor scoreboard..

Post by fiqrialdihardiyan » Wed May 17, 2017 2:26 am

i Already have a scoreboard with controller from android apps, but this scoreboard just add the score and not for team's name , anyone can help me to add the code to insert the name team , its actually just add text from android message but i can't . not scrolling text , just normal text send from android (textbox) to arduino and displaying to p10 with dmd2 library. please help me


this is my codes

// Menyisipkan File library
#include <SPI.h>
#include <DMD2.h>
#include <fonts/SystemFont5x7.h>
#include <fonts/MyBigFont.h>
#include <EEPROM.h>

// Mendifinisikan fungsi
#define bCLEAR A1
#define bRIGHT A2
#define bLEFT A0
#define Panjang 2 // Jumlah panjang Display P10
#define Lebar 1 // Jumlah lebar Display P10

SoftDMD dmd(Panjang, Lebar);
// Deklarasi Variable

byte Brightness;
byte debounce = 100;
int rightScore = 0;
int leftScore = 0;
int i;
char dmdBuff[10];
char BT;

// Fungsi Setup, dikerjakan sekali saat arduino reset
void setup() {
Brightness = EEPROM.read(0);
dmd.setBrightness(10);
dmd.selectFont(SystemFont5x7);
dmd.begin();
dmd.clearScreen();
Serial.begin(9600);
pinMode(bCLEAR,INPUT_PULLUP);
pinMode(bRIGHT,INPUT_PULLUP);
pinMode(bLEFT,INPUT_PULLUP);

blinkDisplay();
}
// Fungsi Blink Display, berfungsi untuk membuat display kedap-kedip
void blinkDisplay(){
dmd.clearScreen();
delay(300);
sprintf(dmdBuff,"%d",leftScore);
dmd.selectFont(SystemFont5x7);
dmd.drawString( 13, 8, dmdBuff );
dmd.selectFont(SystemFont5x7);
dmd.drawString( 29, 8, "-" );
sprintf(dmdBuff,"%2d",rightScore);
dmd.selectFont(SystemFont5x7);
dmd.drawString( 40, 8, dmdBuff );
delay(300);
dmd.clearScreen();
delay(300);
sprintf(dmdBuff,"%d",leftScore);
dmd.selectFont(SystemFont5x7);
dmd.drawString( 13, 8, dmdBuff );
dmd.selectFont(SystemFont5x7);
dmd.drawString( 29, 8, "-");
sprintf(dmdBuff,"%2d",rightScore);
dmd.selectFont(SystemFont5x7);
dmd.drawString( 40, 8, dmdBuff);
delay(300);
dmd.clearScreen();
delay(300);
}
//Fungsi GOAL, menampilkan text GOAL saat input dimasukan
void GOAL(){
dmd.clearScreen();
delay(400);
dmd.selectFont(MyBigFont);
dmd.drawString(5, 0, "GOAL!!!" );
delay(400);
dmd.selectFont(MyBigFont);
dmd.clearScreen();
delay(400);
dmd.selectFont(MyBigFont);
dmd.drawString(5, 0, "GOAL!!!" );
delay(3000);
}
// Fungsi Loop, dikerjakan berulang-ulang
void loop() {
if(Serial.available()){
BT = Serial.read();
}
if(digitalRead(bCLEAR) == LOW || BT == 'X') {
delay(debounce);
leftScore = 0;
rightScore = 0;
dmd.clearScreen();
BT = 0;
}

if(digitalRead(bLEFT) == LOW || BT == 'A') {
delay(debounce);
leftScore++;
GOAL();
blinkDisplay();
BT = 0;
}

if(digitalRead(bRIGHT) == LOW || BT == 'B') {
delay(debounce);
rightScore++;
GOAL();
blinkDisplay();
BT = 0;
}

sprintf(dmdBuff,"%d",leftScore);
dmd.selectFont(SystemFont5x7);
dmd.drawString( 13, 8, dmdBuff );
dmd.selectFont(SystemFont5x7);
dmd.drawString( 29, 8, "-" );
sprintf(dmdBuff,"%2d",rightScore);
dmd.selectFont(SystemFont5x7);
dmd.drawString( 40, 8, dmdBuff );
delay(300);

if(digitalRead(bLEFT) == LOW && digitalRead(bRIGHT) == LOW) {
dmd.clearScreen();
delay(debounce);
setBrightness:
Brightness = EEPROM.read(0);
if(digitalRead(bLEFT) == LOW ){delay(debounce); Brightness++;}
if(digitalRead(bRIGHT) == LOW){delay(debounce); Brightness--;}

EEPROM.write(0,Brightness);
dmd.setBrightness(Brightness);
sprintf(dmdBuff,"%3d ",Brightness);
dmd.drawString( 16, 0, dmdBuff );
delay(50);

if(digitalRead(bCLEAR) == 0){dmd.clearScreen(); delay(debounce); loop();}
else{goto setBrightness;}
}
}

User avatar
stryker
Posts: 244
Joined: Sat Jan 14, 2012 2:44 pm

Re: Building an outdoor scoreboard..

Post by stryker » Wed May 17, 2017 4:21 am

fiqrialdihardiyan wrote:
Wed May 17, 2017 2:26 am
i Already have a scoreboard with controller from android apps, but this scoreboard just add the score and not for team's name , anyone can help me to add the code to insert the name team ,
So looking at the code all your Andriod app is currently transmitting a single character command to reset the score, or increment either team's score by one. To send a team name you're going to have to receive a string of characters rather than a single one. You'll also need to have a way to interpret X, A or B differently if received as a command or in the string (or somehow only play teams that don't include those characters, which seems challenging).

The way I've done it with my scoreboard Andriod app is to make all commands it sends delimited by a ~ character. I do have the score calculated by the android app though, so everything it sends are the strings for display, which is a little different to your method but either works fine. So what you might do, is extend your existing command set by adding the delimiting such that your Android app sends
Hteamnametext~ for sending the home team name
Vteamnametext~ for sending the visiting team name

Your existing A, B and X commands won't need to change, but when a H is the command, your code then needs to continue reading characters until it finds a ~, and put all but the ~ into a string for displaying the home team.

That's just one method, but I think it's an easy enough one for you to add. Hope that helps,
Geoff

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests