100% found this document useful (1 vote)
49 views4 pages

05 - HC05 8x32LED Matrix

The document outlines a project for controlling an 8x32 LED matrix to display scrolling text via Bluetooth using an Arduino UNO and a mobile app. It includes a list of required hardware, circuit setup, and detailed code for implementation. The code handles Bluetooth communication and manages the display settings for the LED matrix to create the scrolling effect.

Uploaded by

vinlse181814
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
49 views4 pages

05 - HC05 8x32LED Matrix

The document outlines a project for controlling an 8x32 LED matrix to display scrolling text via Bluetooth using an Arduino UNO and a mobile app. It includes a list of required hardware, circuit setup, and detailed code for implementation. The code handles Bluetooth communication and manages the display settings for the LED matrix to create the scrolling effect.

Uploaded by

vinlse181814
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

8x32 LED Matrix scrolling text control

using Bluetooth and Android App

Hardware Required
 Arduino UNO Board
 Module Bluetooth HC05
 Module Matrix 8x32 MAX7219 Arduino
 Mobile phone

Circuit

1
Code
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
#include <SoftwareSerial.h>

int pinDIN = 11; // DIN pin of MAX7219 module


int pinCLK = 13; // CLK pin of MAX7219 module
int pinCS = 10; // CS pin of MAX7219 module
int numberOfHorizontalDisplays = 8;
int numberOfVerticalDisplays = 1;

Max72xxPanel matrix = Max72xxPanel(pinCS,


numberOfHorizontalDisplays, numberOfVerticalDisplays);

SoftwareSerial bt(0, 1); /* (Rx,Tx) */

int scrollSpeed = 60;


int spacer = 1;
int width = 5 + spacer;

void setup() {
Serial.begin(9600);
matrix. setIntensity ( 1 ) ; // Adjust the brightness
between 0 and 15
matrix. setPosition ( 0 , 0 , 0 ) ; // The first
display is at <0, 0>

2
matrix. setPosition ( 1 , 1 , 0 ) ; // The second
display is at <1, 0>
matrix. setPosition ( 2 , 2 , 0 ) ; // The third
display is in <2, 0>
matrix. setPosition ( 3 , 3 , 0 ) ; // The fourth
display is at <3, 0>
matrix. setPosition ( 4 , 4 , 0 ) ; // The fifth
display is at <4, 0>
matrix. setPosition ( 5 , 5 , 0 ) ; // The sixth
display is at <5, 0>
matrix. setPosition ( 6 , 6 , 0 ) ; // The seventh
display is at <6, 0>
matrix. setPosition ( 7 , 7 , 0 ) ; // The eighth
display is in <7, 0>
matrix. setPosition ( 8 , 8 , 0 ) ; // The ninth
display is at <8, 0>
matrix. setRotation ( 0 , 1 ) ; // Display position
matrix. setRotation ( 1 , 1 ) ; // Display position
matrix. setRotation ( 2 , 1 ) ; // Display position
matrix. setRotation ( 3 , 1 ) ; // Display position
matrix. setRotation ( 4 , 1 ) ; // Display position
matrix. setRotation ( 5 , 1 ) ; // Display position
matrix. setRotation ( 6 , 1 ) ; // Display position
matrix. setRotation ( 7 , 1 ) ; // Display position
matrix. setRotation ( 8 , 1 ) ; // Display position
bt.begin(9600);
}

void loop() {
String s = "";
long int time = millis();
while (bt.available()) {
s += char(bt.read());
}

s.remove(s.length() - 2);

for (int i = 0; i < width * s.length() + matrix.width() -


1 - spacer; i++ ) {
matrix.fillScreen(LOW);
int letter = i / width;
int x = (matrix.width() - 1) - i % width;

3
int y = (matrix.height() - 8) / 2;

while (x + width - spacer >= 0 && letter >= 0) {


if (letter < s.length()) {
matrix.drawChar(x, y, s[letter], HIGH, LOW, 1);

}
letter--;
x -= width;
}
matrix.write();
delay(scrollSpeed);
}
}

Demonstrations

You might also like