Skip to content
Snippets Groups Projects
Commit d7abc17d authored by Orhan-Timo Altan's avatar Orhan-Timo Altan
Browse files

bits_ prefix hinzugefügt

parent b19b0daf
No related branches found
No related tags found
No related merge requests found
...@@ -35,12 +35,12 @@ Zur Verwendung siehe zunächst das Beispiel `measurement.ino` ...@@ -35,12 +35,12 @@ Zur Verwendung siehe zunächst das Beispiel `measurement.ino`
**Einbinden der Bibliothek:** **Einbinden der Bibliothek:**
```arduino ```arduino
#include "time_of_flight_controller.h" #include "bits_time_of_flight_controller.h"
``` ```
**Instanziieren:** **Instanziieren:**
```arduino ```arduino
TimeOfFlightController tof_controller; bits_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:**
......
#include "time_of_flight_controller.h" #include "bits_time_of_flight_controller.h"
void TimeOfFlightController::init() { void bits_TimeOfFlightController::init() {
for (int i = 0; i < SENSOR_COUNT; i++) for (int i = 0; i < SENSOR_COUNT; i++)
{ {
pinMode(sensors[i].shutdown_pin, OUTPUT); pinMode(sensors[i].shutdown_pin, OUTPUT);
...@@ -38,7 +38,7 @@ void TimeOfFlightController::init() { ...@@ -38,7 +38,7 @@ void TimeOfFlightController::init() {
} }
} }
int TimeOfFlightController::get_distance(int index) { int bits_TimeOfFlightController::get_distance(int index) {
VL53L0X_RangingMeasurementData_t measure; VL53L0X_RangingMeasurementData_t measure;
sensors[index].psensor->rangingTest(&measure, false); // 'true' um debug Informationen auszugeben sensors[index].psensor->rangingTest(&measure, false); // 'true' um debug Informationen auszugeben
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define _println_tof_(x) #define _println_tof_(x)
#endif #endif
class TimeOfFlightController class bits_TimeOfFlightController
{ {
public: public:
void init(); void init();
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
private: private:
static const int SENSOR_COUNT = 5; static const int SENSOR_COUNT = 5;
int TOF_XSHUTS [SENSOR_COUNT] = {0, 8, 9, 29, 23}; // XShut Pins der einzelnen Time of Flight Sensoren int TOF_XSHUTS [SENSOR_COUNT] = {0, 9, 11, 31, A10}; // XShut Pins der einzelnen Time of Flight Sensoren
int TOF_ADDRESSES [SENSOR_COUNT] = {0x30, 0x31, 0x32, 0x33, 0x34}; // Adresse der einzelnen Time of Flight Sensoren int TOF_ADDRESSES [SENSOR_COUNT] = {0x30, 0x31, 0x32, 0x33, 0x34}; // Adresse der einzelnen Time of Flight Sensoren
typedef struct typedef struct
......
// #define DEBUG_TOF // #define DEBUG_TOF
#include "time_of_flight_controller.h" #include "bits_time_of_flight_controller.h"
TimeOfFlightController tof_controller; bits_TimeOfFlightController tof_controller;
int values[5] = {}; int values[5] = {};
void setup() void setup()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment