smaffer / espvgax

ESP8266 VGA Library for Arduino
160 stars 24 forks source link

SoftwareSerial not working with ESPVGAX #3

Open pfugazzi opened 6 years ago

pfugazzi commented 6 years ago

Hi ,

implementing the following code the serial isn't working while removing ESPVGAX code lines anything ii's ok. Any suggestion?

include

include

include <fonts/monodos12.h>

ESPVGAX vga;

String messageTemp ; String messageRcv ;

char data = 0; int VGAy=0; int RcvIndex=0; //static const int RXPin = D6, TXPin = D5; static const int RXPin = D6, TXPin = D8;

SoftwareSerial Raspi(RXPin, TXPin);

void setup() { // put your setup code here, to run once: Serial.begin(115200); delay (30); Raspi.begin(9600); delay (30); vga.begin(); vga.setBitmapFont((uint8_t*)img_monodos12_data, 12); Serial.println("Hello !"); }

void loop() { // put your main code here, to run repeatedly: if(Raspi.available()>0) { data=Raspi.read(); if (data == '\n'){ messageTemp += data; messageRcv = messageTemp; Serial.println(messageRcv); char charBuf[messageRcv.length()+1]; messageRcv.toCharArray(charBuf,messageRcv.length()+1); vga.print (charBuf,0, 0, true, messageRcv.length()+1, ESPVGAX_OP_SET, false, 0,false); messageTemp = ""; VGAy += 1; }
else { messageTemp += data; } }

//Serial.println(messageTemp);

}

smaffer commented 6 years ago

Hello Maybe SoftwareSerial use the sale timer of ESPVGAX? Can you try to modify loop to do a busy loop and never return, like in the examples?

Il giorno mer 14 nov 2018, 17:55 pfugazzi notifications@github.com ha scritto:

Hi ,

implementing the following code the serial isn't working while removing ESPVGAX code lines anything ii's ok. Any suggestion?

include

include

include <fonts/monodos12.h>

ESPVGAX vga;

String messageTemp ; String messageRcv ;

char data = 0; int VGAy=0; int RcvIndex=0; //static const int RXPin = D6, TXPin = D5; static const int RXPin = D6, TXPin = D8;

SoftwareSerial Raspi(RXPin, TXPin);

void setup() { // put your setup code here, to run once: Serial.begin(115200); delay (30); Raspi.begin(9600); delay (30); vga.begin(); vga.setBitmapFont((uint8_t*)img_monodos12_data, 12); Serial.println("Hello !"); }

void loop() { // put your main code here, to run repeatedly: if(Raspi.available()>0) { data=Raspi.read(); if (data == '\n'){ messageTemp += data; messageRcv = messageTemp; Serial.println(messageRcv); char charBuf[messageRcv.length()+1]; messageRcv.toCharArray(charBuf,messageRcv.length()+1); vga.print (charBuf,0, 0, true, messageRcv.length()+1, ESPVGAX_OP_SET, false, 0,false); messageTemp = ""; VGAy += 1; } else { messageTemp += data; } }

//Serial.println(messageTemp);

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/smaffer/espvgax/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AHY7rOnGmMz_PsbsdJnSLRMryLdt7IE1ks5uvErpgaJpZM4YeKd_ .

pfugazzi commented 6 years ago

Did it but till not working

void loop() { // put your main code here, to run repeatedly: while (1) { if(Raspi.available()>0) { data=Raspi.read(); if (data == '\n'){ messageTemp += data; messageRcv = messageTemp; Serial.println(messageRcv); char charBuf[messageRcv.length()+1]; messageRcv.toCharArray(charBuf,messageRcv.length()+1); vga.print (charBuf,0, 0, true, messageRcv.length()+1, ESPVGAX_OP_SET, false, 0,false); messageTemp = ""; VGAy += 1; }
else { messageTemp += data; } }

//Serial.println(messageTemp);

}//while }