summaryrefslogtreecommitdiff
path: root/code/debug/camera/communication/rx_teensy/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'code/debug/camera/communication/rx_teensy/src/main.cpp')
-rw-r--r--code/debug/camera/communication/rx_teensy/src/main.cpp19
1 files changed, 19 insertions, 0 deletions
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 <Arduino.h>
+
+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);
+
+}