Hi,
I would like to communicate via the UART Port of the “Wio Terminal Battery Chassis”. But it doesn’t work.
I have 2 “Wio Terminals” and “Wio Terminal Battery Chassis”. So, I plug a Grove cable into the Grove interface “ITXD; RXD; 3V3; GND” of both and write sender and receiver scripts.
sender script
#include <TFT_eSPI.h>
TFT_eSPI tft;
// Stock font and GFXFF reference handle
TFT_eSprite spr = TFT_eSprite(&tft); // Sprite
int zahl = 0;
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
tft.begin();
tft.setRotation(1);
spr.createSprite(tft.width(),tft.height());
}
void loop() {
spr.fillSprite(TFT_BLACK);
spr.setFreeFont(&FreeSansBoldOblique18pt7b);
spr.setTextColor(TFT_BLUE);
zahl = zahl + 1;
if (zahl > 42) zahl = 1;
spr.drawNumber(zahl, 15, 15);
Serial.write(zahl);
spr.pushSprite(0, 0);
// delay(3000);
}
receiver script
#include <TFT_eSPI.h>
TFT_eSPI tft;
// Stock font and GFXFF reference handle
TFT_eSprite spr = TFT_eSprite(&tft); // Sprite
int receivedByte;
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
tft.begin();
tft.setRotation(1);
spr.createSprite(tft.width(),tft.height());
}
void loop() {
spr.fillSprite(TFT_BLACK);
spr.setFreeFont(&FreeSansBoldOblique18pt7b);
spr.setTextColor(TFT_BLUE);
// Returns the first byte from the serial buffer
if (Serial.available() > 0) {
receivedByte = Serial.read();
spr.drawNumber(receivedByte, 15, 15);
} else {
spr.drawString("No Signal", 15, 15);
}
spr.pushSprite(0, 0);
// delay(3000);
}
Thanks,
Kay