#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10);
String textMessage;
#include <Adafruit_GFX.h>
#include <FastLED.h>
#include <FastLED_NeoMatrix.h>
#define PIN 6
#define mw 6
#define mh 9
#define NUMMATRIX (mw*mh)
CRGB matrixleds[NUMMATRIX];
FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(matrixleds, mw, mh, mw/6, 1,
NEO_MATRIX_TOP + NEO_MATRIX_RIGHT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG );
const uint16_t colors[] = {
matrix->Color(255, 0, 0), matrix->Color(0, 255, 0), matrix->Color(0, 0, 255) };
void setup() {
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
FastLED.addLeds<NEOPIXEL,PIN>(matrixleds, NUMMATRIX);
matrix->begin();
matrix->setTextWrap(false);
matrix->setBrightness(40);
matrix->setTextColor(colors[0]);
}
int x = mw;
int pass = 0;
void loop() {
if(mySerial.available()>0){
textMessage = mySerial.readString();
Serial.print(textMessage);
delay(10);
}
matrix->fillScreen(0);
matrix->setCursor(x, 1);
matrix->print(textMessage.indexOf(“”));
if(–x < -15) {
x = matrix->width();
if(++pass >= 3) pass = 0;
matrix->setTextColor(colors[pass]);
}
matrix->show();
delay(300);
}
help me again guys I’m working with my project right now , that the message will display in RGB LED strip using a text message(SMS) . My problem is my project keep displaying between -1 and 0 .
matrix->print(textMessage.indexOf(“”)); this is the code
what is the right code to get the data or text in GSM Module . TIA guys