diff options
| author | Abel Tim <abel.tim.t@gmail.com> | 2025-03-23 12:38:48 +0100 |
|---|---|---|
| committer | Abel Tim <abel.tim.t@gmail.com> | 2025-03-23 12:38:48 +0100 |
| commit | 764c8722596f5b3bd01bb26848f7289b0972d7b0 (patch) | |
| tree | 73b8090d371b0c0479f1b72803f3e0e0f0754dc1 /CODE/debug/IR/communication/rx_teensy | |
| parent | a52c13fdf50fbc19dfdce2d087b4739b96d46a0b (diff) | |
| download | robotica-764c8722596f5b3bd01bb26848f7289b0972d7b0.tar.gz robotica-764c8722596f5b3bd01bb26848f7289b0972d7b0.zip | |
updated repo structure
Diffstat (limited to 'CODE/debug/IR/communication/rx_teensy')
| -rw-r--r-- | CODE/debug/IR/communication/rx_teensy/rx_teensy.ino | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/CODE/debug/IR/communication/rx_teensy/rx_teensy.ino b/CODE/debug/IR/communication/rx_teensy/rx_teensy.ino deleted file mode 100644 index 68a768b..0000000 --- a/CODE/debug/IR/communication/rx_teensy/rx_teensy.ino +++ /dev/null @@ -1,35 +0,0 @@ -int incomingbyte = 0; -bool iswriting = false; -String tlocdat = ""; //temporary location data -String locdat = ""; //location data -int nir = "-99"; // which ir sensor it is -int pir = "-99"; // amount of pulses it had -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", &nir, &pir); - Serial.print("IR sensor N: "); - Serial.print(nir); - Serial.print(", with "); - Serial.print(pir); - Serial.println(" pulses."); - delay(10); -} |
