I need help making a serial mirror for Arduino UNO project

Viewed 22

hi guys im working with a screen and sound update for bitlash

My arduino unos connection:

Mirrors RX = 6 TX = 7 hardware/software serial connected extras for bitlash:

void loop() {

  while (Serial.available()) {
    delay(2);  //delay to allow byte to arrive in input buffer
    char c = Serial.read();
    readString += c;
  }

  if (readString.length() >0) {
    Serial.println(readString);
    tft.print(readString);
    
         if (readString.startsWith("RECTSH"))
   {
       Serial.println(readString.substring(23, 28));
    tft.fillRect(readString.substring(7, 10).toInt() , readString.substring(11, 14).toInt()  ,  readString.substring(15, 18).toInt(), readString.substring(19, 22).toInt(), readString.substring(23, 28).toInt());
       tft.drawRect(readString.substring(7, 10).toInt() , readString.substring(11, 14).toInt()  ,  readString.substring(15, 18).toInt(), readString.substring(19, 22).toInt(), readString.substring(23, 28).toInt());


  }
         if (readString.startsWith("CIRCSH"))
   {
    tft.fillCircle(readString.substring(7, 10).toInt() , readString.substring(11, 14).toInt() , readString.substring(15, 18).toInt(), readString.substring(19, 24).toInt());

  } 
           if (readString.startsWith("BITMAP"))
   {
    drawBitmap(readString.substring(7, 10).toInt() , readString.substring(11, 14).toInt()  ,  readString.substring(15, 18).toInt(), readString.substring(19, 22).toInt(), Bitmap1);

  } 

Mirror Code

void setup() {
    Serial.begin(115200);
    //Serial.begin(9600);
    Serial.write('B');
}

void loop() {
    if (Serial.available() > 0) {
        Serial.write(Serial.read());
    }
}

when i print what i got from bitlash one, test word is basically doesnt stop and i didnt even say

0 Answers
Related