From c007afbd2c1339d58a582a905f07a5b39ddaafbd Mon Sep 17 00:00:00 2001 From: Abel Tim Date: Mon, 12 May 2025 20:56:11 +0200 Subject: cam comm + readme -4 Multi-line description of commit, feel free to be detailed. Signed-off-by: Abel Tim --- .../debug/camera/communication/rx_teensy/src/main.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 code/debug/camera/communication/rx_teensy/src/main.cpp (limited to 'code/debug/camera/communication/rx_teensy/src/main.cpp') diff --git a/code/debug/camera/communication/rx_teensy/src/main.cpp b/code/debug/camera/communication/rx_teensy/src/main.cpp new file mode 100644 index 0000000..5491bab --- /dev/null +++ b/code/debug/camera/communication/rx_teensy/src/main.cpp @@ -0,0 +1,19 @@ +// this code is for Teensy 4.1 to read serial data and relay it to serial 1(computer) + +#include + +int incomingbyte = 0; +void setup() { + Serial.begin(9600); + Serial1.begin(9600); + Serial.print("Starting ...."); +} + +void loop() { + if (Serial1.available() > 0) { + incomingbyte = Serial1.read(); + Serial.print(char(incomingbyte)); + } + milis(1); + +} -- cgit v1.2.3