summaryrefslogtreecommitdiff
path: root/code/debug/communication/rx/rx_decode_teensy/src
diff options
context:
space:
mode:
authorAbel Tim <git@abeltim.com>2025-05-11 22:01:13 +0200
committerAbel Tim <git@abeltim.com>2025-05-11 22:01:13 +0200
commit1fb85fcf2582320cc41621b90adbb0a1aef551e0 (patch)
treede069e33a26c801f9488f79099e2dca02e357728 /code/debug/communication/rx/rx_decode_teensy/src
parent4680274ed48b38fdcc3ab292ad4856312977a9e4 (diff)
downloadrobotica-1fb85fcf2582320cc41621b90adbb0a1aef551e0.tar.gz
robotica-1fb85fcf2582320cc41621b90adbb0a1aef551e0.zip
added encoder again
Multi-line description of commit, feel free to be detailed. Signed-off-by: Abel Tim <git@abeltim.com>
Diffstat (limited to 'code/debug/communication/rx/rx_decode_teensy/src')
-rw-r--r--code/debug/communication/rx/rx_decode_teensy/src/main.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/code/debug/communication/rx/rx_decode_teensy/src/main.cpp b/code/debug/communication/rx/rx_decode_teensy/src/main.cpp
deleted file mode 100644
index 07639ce..0000000
--- a/code/debug/communication/rx/rx_decode_teensy/src/main.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <Arduino.h>
-
-int incomingbyte = 0;
-bool iswriting = false;
-String tlocdat = ""; //temporary location data
-String locdat = ""; //location data
-int ir1 = -99;
-int ir2 = -99;
-int ir3 = -99;
-int ir4 = -99;
-int ir5 = -99;
-int ir6 = -99;
-int ir7 = -99;
-int ir8 = -99;
-
-
-void setup() {
- Serial.begin(9600);
- Serial3.begin(9600); //19200
-}
-
-void loop() {
- if (Serial3.available() > 0) {
- incomingbyte = Serial3.read();
- //Serial.print(char(incomingbyte));
- if (incomingbyte == 's'){
- iswriting = true;
- tlocdat = "";
- }else if(incomingbyte == 'e'){
- iswriting = false;
- locdat = tlocdat;
- }else if(iswriting == true){
- //Serial.print(char(incomingbyte));
- tlocdat += (char)incomingbyte;
- }
- }
- //Serial.println(locdat);
- sscanf(locdat.c_str(), "%d, %d, %d, %d, %d, %d, %d, %d", &ir1, &ir2, &ir3, &ir4, &ir5, &ir6, &ir7, &ir8);
- Serial.print("IR sensor N: ");
- Serial.print(ir1);
- Serial.print(ir2);
- Serial.print(ir3);
- Serial.print(ir4);
- Serial.print(ir5);
- Serial.print(ir6);
-
- delayMicroseconds(1);
-}