Skip to content
Snippets Groups Projects
Commit 759bb547 authored by Severin Landwein's avatar Severin Landwein
Browse files

change names

parent 5956d75f
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ Möchte man mehr als 5 Time of Flight Sensoren verwenden, so müssen ebenfalls a ...@@ -29,7 +29,7 @@ Möchte man mehr als 5 Time of Flight Sensoren verwenden, so müssen ebenfalls a
## **Anwendung**:<br /> ## **Anwendung**:<br />
<br /> <br />
Zur Verwendung siehe zunächst das Beispiel `tof_array.ino` Zur Verwendung siehe zunächst das Beispiel `measurement.ino`
<br /> <br />
...@@ -40,12 +40,12 @@ Zur Verwendung siehe zunächst das Beispiel `tof_array.ino` ...@@ -40,12 +40,12 @@ Zur Verwendung siehe zunächst das Beispiel `tof_array.ino`
**Instanziieren:** **Instanziieren:**
```arduino ```arduino
TimeOfFlightController tof_array; TimeOfFlightController tof_controller;
``` ```
**Zum messen mit den Time of Flight Sensoren wird folgende Methode verwendet:** **Zum messen mit den Time of Flight Sensoren wird folgende Methode verwendet:**
```arduino ```arduino
int value = tof_array.get_distance(index); int value = tof_controller.get_distance(index);
``` ```
- `index`: Time of Flight Sensor Nummer 0-4 - `index`: Time of Flight Sensor Nummer 0-4
......
#define DEBUG_TOF // #define DEBUG_TOF
#include "time_of_flight_controller.h" #include "time_of_flight_controller.h"
TimeOfFlightController tof_array; TimeOfFlightController tof_controller;
int test[5] = {}; int values[5] = {};
void setup() void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
Wire.begin(); Wire.begin();
tof_array.init(); tof_controller.init();
} }
void loop() void loop()
{ {
test[0] = tof_array.get_distance(0); values[0] = tof_controller.get_distance(0);
test[1] = tof_array.get_distance(1); values[1] = tof_controller.get_distance(1);
test[2] = tof_array.get_distance(2); values[2] = tof_controller.get_distance(2);
test[3] = tof_array.get_distance(3); values[3] = tof_controller.get_distance(3);
test[4] = tof_array.get_distance(4); values[4] = tof_controller.get_distance(4);
Serial.print(test[0]); Serial.print(values[0]);
Serial.print(" "); Serial.print(" ");
Serial.print(test[1]); Serial.print(values[1]);
Serial.print(" "); Serial.print(" ");
Serial.print(test[2]); Serial.print(values[2]);
Serial.print(" "); Serial.print(" ");
Serial.print(test[3]); Serial.print(values[3]);
Serial.print(" "); Serial.print(" ");
Serial.println(test[4]); Serial.println(values[4]);
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment