From 6b328bb4ca0184dc39f0184d1ad2f47b46e5d6d7 Mon Sep 17 00:00:00 2001 From: Abel Tim Date: Sun, 23 Mar 2025 16:33:05 +0100 Subject: serial --- code/debug/communication/rx/rx_teensy/src/main.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 code/debug/communication/rx/rx_teensy/src/main.cpp (limited to 'code/debug/communication/rx/rx_teensy/src') diff --git a/code/debug/communication/rx/rx_teensy/src/main.cpp b/code/debug/communication/rx/rx_teensy/src/main.cpp new file mode 100644 index 0000000..f8e33a1 --- /dev/null +++ b/code/debug/communication/rx/rx_teensy/src/main.cpp @@ -0,0 +1,19 @@ +// this code is for Teensy 4.1 to read serial data + +#include + +int incomingbyte = 0; +void setup() { + Serial.begin(9600); + Serial2.begin(9600); //19200 + Serial3.begin(9600); //19200 + Serial.print("Starting ...."); +} + +void loop() { + if (Serial3.available() > 0) { + incomingbyte = Serial3.read(); + Serial.print(char(incomingbyte)); + } + +} \ No newline at end of file -- cgit v1.2.3