You are on page 1of 3

/*

Scrolling alphabet demo, displays characters one at a time into a scrolling box.

*/

#include <SPI.h>

#include <DMD2.h>

#include <fonts/SystemFont5x7.h>

<SoftwareSerial.h>

SoftwareSerial gsm(2, 3);

// Set Width to the number of displays wide you have

const int WIDTH = 2;

// You can change to a smaller font (two lines) by commenting this line,

// and uncommenting the line after it:

const char *MESSAGE = "abcdefghijklmnopqrstuvwxyz";

char msg[100];

SoftDMD dmd(WIDTH, 1); // DMD controls the entire display

DMD_TextBox box(dmd); // "box" provides a text box to automatically write to/scroll the display

// the setup routine runs once when you press reset:

void setup() {

dmd.setBrightness(400);

dmd.selectFont(FONT2);
dmd.begin();

Serial.println("AT+CNMI=2,2,0,0,0");

delay(2000);

Serial.println("AT+CMGF=1");

delay(2000);

delay(10000);

// the loop routine runs over and over again forever:

void loop() {

String ss;

char a;

if (Serial.available()) {

if (Serial.find('*'))

ss = Serial.readStringUntil('*');

// Serial.println(ss);

ss.toCharArray(msg, 100);

// Serial.println(msg);

for (int i = 0; msg[i] != '\0'; i++)

//Serial.print(msg[i]);
box.print(msg[i]);

You might also like