with an Arduino Uno, a 20x4 lcd, a simple 4x4 keyboard, and two matrix led units (one for each player) each with 32x8 LEDs, I have created a darts scoreboard, based on those normally found on the market.
So far I have created the program that manages the keyboard, the LCD and then actually manages the keyboard, the two players scores, the reset mode etc. : my intent is to add the two matrix units to show more clearly the score of each player.
Because of the limited pins of the arduino Uno, i decided to connect the 2 MAX72xx units in series: so, now my problem is programming the matrix trying to achieve this:
The score is updated every turn, with this iterative process:
1- the same initial score for both players (therefore the MAX72xx will show the same number for each player ) example: 501;
2-At the beginning of the game (player 1 turn) and consequent subtraction from the initial score of the value of round' score. So the display at the end of round 1 rewrites both scores (player 1 changes, while the 2 one remains the same original score);
3- The turn passes to player 2 and then at the end of round 2 the matrix will show the score 2 changed, while the first one remains unchanged.
4 -...
5 -...
n- and so on 'n' times until one of the two doesn't reach 0.
The matrix at avery "score updating" needs to do a complete display reset (for a few millisecond, the time it uses to put in the new data) ?
How can I use a library like the MD_Parola to achieve this:
the problem is writing a thing like that
these are the 2 max units in series:
| 501 | 501 | :- < ----connection to Arduino from this part
(score 1) (score 2)
second unit first unit of MAX72xx
Each MAX72xx can control one 8 by 8 LED matrix. So for two 32x8 LED display you will need 8 MAX72xx chips. You will probably have to end up writing your own code for that. I don't think you will find a libiary that will do all the work for you. Get hold of the data sheet for the MAX72xx and see, their is really nothing to it to drive a matrix.
Very easy to do using MD_Parola. Set up 2 zones, one for each player. Then the scores can be updated independently very simply using the PRINT animation.
Marco, i've done a small code to understand a basic use of MD_Parola, my doubt is about the use of the displayZoneText function: is it possible to print a variable not defined by an array? The variables named SCORE1 (for the player 1) and SCORE2 (for the player 2) are always numbers between the initial score and 0.
Is this code right? I put the ?? because i don't now how to use it...
I've made a small code to understand the use of MD_Zone: I found a small problem, the first displayText function works good and print "Hello", but after i set the zones, the displayZoneText does not show anything on the MAX72xx...There will definitely be something wrong, but i cannot find it.
The .print() method does this for you so it works. If you want to animate an animation, this takes time, so it cannot be done in one call or the software will behave as if it is in a call to delay() - everything stops.
Look at the example programs and observe that they all call displayAnimate() in the main loop. For example:
if (P.displayAnimate()) // animates and returns true when an animation is completed
{