P10 display part 3 (wireless control)

This is the part 3 and probably the last part of my P10 display tutorial series. I have already shown
you how to use this display and connect multiple displays or show sensor data on it. In this part i will mainly focus on using this display wireless.

Things you need:
Arduino UNO
P10 driver Arduino shield
P10 display
5v wall adapter
HC-05 Bluetooth Module

Building:

Hardware:

As I have already shown you how to make arduino shield for displays and how to connect two
displays together. In this part we will only focus on how to send data wirelessly . For wireless
communication i am using bluetooth chip. In this way i will send data thorough mobile app over
bluetooth to arduino to display data on P10 panels. Connecting bluetooth to arduino is simple just
connect Tx of bluetooth to Rx of arduino and Rx of bluetooth to Tx of arduino. Its that simple but
make sure to unplug these wires while uploading code to your arduino.

For app i am using RemoteXY app which you 􀃗nd easily on play store, you only have to do some
settings according to your setup like choosing bluetooth module, arduino board, type of serial
communication and etc.

Software:

In arduino we will first define the libraries we need.

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__HARDSERIAL>
#include <SPI.h>
#include <DMD2.h>
#include <fonts/SystemFont5x7.h>
#include <fonts/Arial14.h>
#include <RemoteXY.h>

After that we will set baud rate and bluetooth device and some settings of mobile app. We will also
declare a string to store incoming data.

#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 9600
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,11,0,0,0,13,0,8,13,0,
7,36,26,25,55,12,2,26,2,11 };
// this structure de􀃗nes all the variables of your control interface
struct {
// input variable
char string[11]; // string UTF8 end zero
// other variable
uint8_t connect_􀃘ag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
then we will de􀃗ne the amount of panels we are using also the font we want to use.
const int WIDTH = 2;
// You can change to a smaller font (two lines) by commenting this line,
// and uncommenting the line after it:
const uint8_t *FONT = Arial14;
//const uint8_t *FONT = SystemFont5x7;
const char *MESSAGE;
SoftDMD dmd(WIDTH,1); // DMD controls the entire display
DMD_TextBox box(dmd);

In the setup section we will initiate RemoteXY, set the brightness of panels and also starting the
communication with panels.

void setup()
{
RemoteXY_Init ();
dmd.setBrightness(255);
dmd.selectFont(FONT);
dmd.begin();
Serial.begin(9600);
// TODO you setup code
}

In the loop section we will receive the data from RemoteXY app and store it in string after which we
will send one character after another to the display. In this way we will repeat this steps again and
again.

void loop()
{
RemoteXY_Handler ();
MESSAGE = RemoteXY.string;
Serial.println(MESSAGE);
const char *next = MESSAGE;
while(*next) {
Serial.print(*next);
box.print(*next);
delay(200);
next++;
}
// TODO you loop code
// use the RemoteXY structure for data transfer}

Leave a Reply

Your email address will not be published. Required fields are marked *