Progm issues with sending text from one Arduino to another Arduino with display

Hey guys a few months ago I started learning how to code and make projects with Arduino and I'm having some issues with my first project that I cant seem to get around and I really really need help.

Right now I'm trying to make a HC-05 Bluetooth controlled led matrix using a MAX7219 LED dot matrix display.
I've seen a lot of videos that where people are able to send text via a android smartphone and have it displayed on the MAX7219 LED dot matrix display but I'm trying remove the android phone from the equation and use an Arduino connected to a HC-05 to speak to another Arduino to display a message when a specific button is pressed on the master Arduino.

I already paired and bonded the two HC-05 Bluetooth modules using the AT-commands. I have the Baud rate at 9600 for both modules. I tested the the connection with a basic push button led library and that was successful but now I'm trying to add the MAX7219 LED dot matrix display to the equation and I'm not able to get anything displaying on the MAX7219 LED dot matrix display when I push the button on the master side.

Ill post my code down below starting with the master side first. Like I stated earlier I am brand new to programming and have very little knowledge on Arduino so I apologies if I am missing some of the basic rules of programming. Thanks in advance.

Master code: #include <SoftwareSerial.h>
const int pinButton = 8;
SoftwareSerial BTSerial(0, 1); // RX | TX

void setup() {
pinMode(pinButton, INPUT);
Serial.begin(9600);
BTSerial.begin(9600);

}

void loop() {
int stateButton = digitalRead(pinButton);
if(stateButton == 1) {
BTSerial.write("1");
} else {
BTSerial.write("0");
}
delay(800);
}
}
}
// end master code

((((Slave side code with the led matrix.:)))

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
// Define hardware type, size, and output pins:
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 8
#define CS_PIN 3

#include <SoftwareSerial.h>
SoftwareSerial BTSerial(0, 1); // RX | TX
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
textEffect_t scrollEffect = PA_SCROLL_RIGHT;
char val = BTSerial.read();
void setup() {
Serial.begin(9600);
BTSerial.begin(9600); // HC-05 default speed in AT command more
Serial.begin(9600);
myDisplay.begin();
// Set the intensity (brightness) of the display (0-15):
myDisplay.setIntensity(10);
// Clear the display:
myDisplay.displayClear();
myDisplay.displayText("Welcome to OMA", PA_CENTER, 100, 0, PA_SCROLL_RIGHT, PA_SCROLL_RIGHT);
myDisplay.displayClear();
}

void loop()
{ if (myDisplay.displayAnimate())
{
delay(2000);

myDisplay.displayText("Welcome to OMA", PA_CENTER, 100, 0, PA_SCROLL_RIGHT, PA_SCROLL_RIGHT);
delay(3000);
myDisplay.displayReset();
}

// put your main code here, to run repeatedly:
if(BTSerial.available())
{
char val = BTSerial.read();
if(val == '0')
{
myDisplay.println("Test");
}
else if(val == '1')
{
myDisplay.print("EndTest");
}
}
}
** // end slave side code. **

IMG_0018.jpg

IMG_0017.jpg

IMG_0018.jpg

IMG_0017.jpg

The Arduino Uno has a hardware serial port on pin 0 and 1. They are used to upload a sketch and for the serial monitor. Therefor you better not use pin 0 or pin 1. Can you use other pins for the Bluetooth ?

In the Arduino IDE, press Ctrl+T to make the text look better. After that, it is easier to fix the brackets.

On this forum, please put the sketch between code-tags. The </> button is for code-tags.

You compare the return value of digitalRead() with a 1
However, the return value is HIGH or LOW.
digitalRead() - Arduino Reference.

Do you know the maximum current of those led matrixes ?
The Arduino 5V pin is for sensors, it is not a power output for so many leds.

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.