M5Stack together with Controllino - Serial transmission problems
-
I want to read data that are send serial from the Controllino Mini USB-B port to M5Stack. Serial transmission is available and can be seen if I connect a PC with the USB-A port. A COM-Port is generated and HTERM can log the data. On M5Stack with the USB-B to USB-C connection, no values are displayed. I successfully tried to transmit Data from the PC to M5Stack with an USB-A to USB-C cable.
What is different with the USB-B to USB-C cable?
Is the problem with the Controllino or the M5Stack or the cable?
What is necessary that Controllino Mini sends the data and M5Stack can interprete this data?Thank you for your help?
Here the code:
'''
#include <M5Stack.h>String receivedString = "";
bool newData = false;void setup() {
M5.begin();
M5.Power.begin();Serial.begin(115200);
M5.Lcd.setTextSize(2);
M5.Lcd.setTextColor(WHITE, BLACK);
M5.Lcd.println("Warte auf Daten...");
}void loop() {
while (Serial.available() > 0) {
char incomingChar = Serial.read();
if (incomingChar == '\n') {
newData = true;
} else {
receivedString += incomingChar;
}
}if (newData) {
M5.Lcd.fillScreen(BLACK);
M5.Lcd.setCursor(0, 0);
M5.Lcd.println("Empfangen:");
M5.Lcd.println(receivedString);receivedString = ""; newData = false;}
M5.update();
}
'''
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login