Hackster will be offline on Monday, September 30 from 8pm to 10pm PDT to perform some scheduled maintenance.
stevie135s
Published © GPL3+

Scrolling Text Matrix with Bluetooth app control

Scrolling text on a 32x8 WS2812b matrix with bluetooth control using an Android app

IntermediateWork in progress2,128
Scrolling Text Matrix with Bluetooth app control

Things used in this project

Hardware components

Arduino ESP32 WROOM
×1
8x32 WS2812b Matrix
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

Mobile Phone app

Download this and install it on your Android phone

Schematics

Wiring

The signal pin i used is GPIO 25

Code

BT_Text

Arduino
Use the Arduino IDE to compile and send to the ESP32
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#include <BluetoothSerial.h> // Available here : https://github.com/espressif/arduino-esp32/tree/master/libraries/BluetoothSerial

BluetoothSerial BT_Text;

#define PIN 25 // This is the led signal pin

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(32, 8, PIN,
  NEO_MATRIX_TOP    + NEO_MATRIX_LEFT +
  NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
  NEO_GRB            + NEO_KHZ800);

int i; 
String Text;
int x = matrix.width();
int Size;

const uint16_t colors[] = {
  matrix.Color(204, 0, 204), matrix.Color(204, 204, 0), matrix.Color(0, 255, 255),
  matrix.Color(255, 10, 127), matrix.Color(127, 0, 255), matrix.Color(0, 255, 0),
  matrix.Color(255, 99, 255), matrix.Color(204,177,0), matrix.Color(0,0,244) };  // Colour presets

void PrintOut() {
  while (!BT_Text.available()) {
    }
    while (BT_Text.available()) {
      i = BT_Text.read();
      Text = Text + char (i);
    }
}


  

void setup() {
 // Serial.begin(115200);
  BT_Text.begin("BT_Text");  //Name of the Bluetooth interface (On your phone)
  matrix.begin();
  matrix.setTextWrap(false);
  matrix.setBrightness(40);
  matrix.setTextColor(colors[0]);
  Text = "*MERRY CHRISTMAS*";
  Size = Text.length()*6;
}



void loop() {
  if (BT_Text.available()) {
    i = BT_Text.read();
      if (i < 9) {
      matrix.setTextColor(colors[i]);
      }
      else {
        Text = "";
        PrintOut();
        Size = Text.length()*6;
      }
      }
  matrix.fillScreen(0);    //Turn off all the LEDs
  matrix.setCursor(x, 0);
  matrix.print(Text);
  if ( --x < -Size) {
    x = matrix.width();
  }
  matrix.show();
  delay(50);
}

Credits

stevie135s

stevie135s

24 projects • 10 followers

Comments