Notifications
Clear all

New to arduino programming with the 8x8 display

15 Posts
2 Users
0 Likes
731 Views
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

Hello, i am new to getting the 8x8 max7219 4 unit displays to work i am able to get the test code from the https://dronebotworkshop.com/led-displays/ to work but i would like to have a way to change the text from say text 1 to text 2 to text 3 etc with a input from a momentary switch, how would it be set up and how to add to the cct as well, brain is sort of going duhh πŸ™‚Β 

Β 

thanksΒ Β 


   
Quote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

Forgot one thing what is the best way to connect 2 of the 4x8x8 led displays together i see the 90 deg male header wish it came with a female header as wellΒ Β 

Β 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 
Posted by: @laserman

Hello, i am new to getting the 8x8 max7219 4 unit displays to work i am able to get the test code from the https://dronebotworkshop.com/led-displays/ to work but i would like to have a way to change the text from say text 1 to text 2 to text 3 etc with a input from a momentary switch, how would it be set up and how to add to the cct as well, brain is sort of going duhh πŸ™‚Β 

Β 

thanksΒ Β 

Not quite sure what you mean by "text 1" ? How does that differ from displaying the number "1" ?

Maybe set up 2 buttons and check 'em both on your way through the loop. Use 1 to increment the count and Β use the other to decrement the count.

If you want to get fancy, press both to zero the count πŸ™‚

What's a cct ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

i would like to change with a momentary switch the text that is displayed from IEΒ  "hello " to "gone for Lunch" etc, and CCT is short for circuit πŸ™‚

also i know i would have the different text in a data array and when i hit the switch i would like to change the text that is displayedΒ 

This post was modified 2 years ago by Laserman

   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 
Posted by: @laserman

Forgot one thing what is the best way to connect 2 of the 4x8x8 led displays together i see the 90 deg male header wish it came with a female header as well Β 

Hard to say without knowing what model you bought. Usually the ones that chain together have a male header on one end and holes in the other end of the PCB. You just daisy chain them together.

Maybe you could describe your 7 segment displays or provide some more details. We can't see your bench from here πŸ™‚

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

this the units i have https://www.amazon.ca/gp/product/B07X95H9DT/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

Β 

i have 2 of them


   
ReplyQuote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

here's the sketch from the page

Β 

/*
Matrix Display Scrolling Demo
matrix-scroll-demo.ino
Scrolls text on a 4-element 8x8 LED matrix display

DroneBot Workshop 2022
https://dronebotworkshop.com
*/

// Include the required libraries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Specify display hardware type
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
//#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW

// Display Size and CS Pin
#define MAX_DEVICES 4
#define CS_PIN 10

// Create a display object
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {

// Intialize the display object
myDisplay.begin();

// Set the intensity (brightness) of the display (0-15)
myDisplay.setIntensity(7);

// Clear the display
myDisplay.displayClear();

// Display our text in a scroll
myDisplay.displayScroll("Welcome to RFL were the real work gets done !!!", PA_CENTER, PA_SCROLL_LEFT, 100);
}

void loop() {

// Ensure display stays animated
if (myDisplay.displayAnimate()) {
myDisplay.displayReset();
}
}


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 
Posted by: @laserman

this the units i have https://www.amazon.ca/gp/product/B07X95H9DT/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

Β 

i have 2 of them

Amazon links don't seem go get along with the software used for the forum, when you click it usually groans out something about Kindle and stops.

I believe that the model you've indicated does just plug into the next module.

You'll probably have to change MAX_DEVICES from 4 to 8.

You can get more information about using the library at the Arduino site at

https://www.arduino.cc/reference/en/libraries/md_parola/

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

there are NO female headers for the connection there are the male but i think i can figure out a connection my main issue is doing the change of the displayed text via a switch to be read by the ArduinoΒ 

thanksΒ 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 

@lasermanΒ 

Pick an unused Arduino pin between 3 and 12. Take your pushbutton switch and connect one side to the Arduino GND and the other side to your selected Β pin.

For illustration purposes, let's use pin 5 on the Arduino.

Make a copy of your working sketch and, at the top after the #includes and before the setup() add the line

const int buttonPin = 5; Β  Β // This is the button

long Β  Β  Β  counter = 0; Β  Β  Β  // This will be the counter

in your setup() routine, add the line

pinMode(buttonPin,INPUT_PULLUP); Β  // This tells the Arduino you'll be reading the pin

Note that the INPUT_PULLUP tells the compiler that you'll be reading the pin (hence INPUT) and also that you want the Arduino to tie the pin to +5V through a 10K resistor (already built into the Arduino, you don't need to add anything else). This will keep the pin value HIGH until it's pressed and then it'll be connected to GND by your wire and will read LOW.

in your loop() function add the following

if (digitalRead(buttonPin)==LOW) { Β  Β // If the button is pushed (i.e. connected to GND)

Β  Β  counter++; Β  Β  // Increment the count

Β  Β  << enter command to display the new number >>

}

So now all you need to do is add the command to display this number using the library you selected.

Β 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

www.amazon.ca/gp/product/B07X95H9DT/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&th=1


   
ReplyQuote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

WELL this is a new weird one got it all working BUT instead of the text going left to right down the length of the 2, 4 unit multi led display the text goes across the individual displays have attached

IMG 0968

Β  how would i get it to go the right way


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 

@lasermanΒ 

First, double check all of the parameters to all calls of your myDisplay instance.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@laserman)
Member
Joined: 2 years ago
Posts: 16
Topic starter  

every thing looks good

heres my sketch

/*
Matrix Display Scrolling Demo
matrix-scroll-demo.ino
Scrolls text on a 4-element 8x8 LED matrix display

DroneBot Workshop 2022
https://dronebotworkshop.com
*/

// Include the required libraries
#include <MD_Parola.h>
#include <MD_MAX72XX.h>
#include <SPI.h>

// Specify display hardware type
//#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW

// Display Size and CS Pin
#define MAX_DEVICES 8
#define CS_PIN 10

// Create a display object
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {

// Intialize the display object
myDisplay.begin();

// Set the intensity (brightness) of the display (0-15)
myDisplay.setIntensity(7);

// Clear the display
myDisplay.displayClear();

// Display our text in a scroll
myDisplay.displayScroll("Welcome to RFL were the real work gets done !!!", PA_RIGHT, PA_SCROLL_LEFT, 50);
}

void loop() {

// Ensure display stays animated
if (myDisplay.displayAnimate()) {
myDisplay.displayReset();
}
}


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 

@lasermanΒ 

Maybe take a closer look at constructor number 2 in the documentation. I think it should be 2 since you have only 2 devices. Seems like MAX_DEVICES should be 2 instead of 8.

Β 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote