Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bits_time_of_flight_controller
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bits_libs
bits_time_of_flight_controller
Commits
f99126d9
Commit
f99126d9
authored
3 years ago
by
Orhan-Timo Altan
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
0e256616
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
BITs_tof_array.h
+13
-11
13 additions, 11 deletions
BITs_tof_array.h
with
13 additions
and
11 deletions
BITs_tof_array.h
+
13
−
11
View file @
f99126d9
...
@@ -20,29 +20,31 @@
...
@@ -20,29 +20,31 @@
#define _println_tof_(x)
#define _println_tof_(x)
#endif
#endif
const
int
TOFS
=
5
;
// Anzahl der zu Verwendenden Time of Flight Sensoren
const
int
TOFS
_COUNT
=
5
;
// Anzahl der zu Verwendenden Time of Flight Sensoren
const
int
TOF_XSHUTS
[
TOFS
]
=
{
0
,
9
,
11
,
31
,
A10
};
// XShut Pins der einzelnen Time of Flight Sensoren
const
int
TOF_XSHUTS
[]
=
{
0
,
8
,
9
,
29
,
23
};
// XShut Pins der einzelnen Time of Flight Sensoren
const
int
TOF_ADDRESSES
[
TOFS
]
=
{
0x30
,
0x31
,
0x32
,
0x33
,
0x34
};
// Adresse der einzelnen Time of Flight Sensoren
const
int
TOF_ADDRESSES
[]
=
{
0x30
,
0x31
,
0x32
,
0x33
,
0x34
};
// Adresse der einzelnen Time of Flight Sensoren
class
BITsTimeOfFlight
class
BITsTimeOfFlight
{
{
public:
public:
void
init
()
void
init
()
{
{
for
(
int
i
=
0
;
i
<
COUNT_SENSORS
;
i
++
)
for
(
int
i
=
1
;
i
<
TOFS_COUNT
;
i
++
)
{
{
pinMode
(
sensors
[
i
].
shutdown_pin
,
OUTPUT
);
pinMode
(
sensors
[
i
].
shutdown_pin
,
OUTPUT
);
digitalWrite
(
sensors
[
i
].
shutdown_pin
,
LOW
);
digitalWrite
(
sensors
[
i
].
shutdown_pin
,
LOW
);
}
}
bool
found_any_sensors
=
false
;
for
(
int
i
=
0
;
i
<
COUNT_SENSORS
;
i
++
)
digitalWrite
(
sensors
[
i
].
shutdown_pin
,
LOW
);
delay
(
10
);
delay
(
10
);
bool
found_any_sensors
=
false
;
for
(
int
i
=
0
;
i
<
COUNT
_SENSORS
;
i
++
)
for
(
int
i
=
0
;
i
<
TOFS_
COUNT
;
i
++
)
{
{
if
(
i
>
0
){
digitalWrite
(
sensors
[
i
].
shutdown_pin
,
HIGH
);
digitalWrite
(
sensors
[
i
].
shutdown_pin
,
HIGH
);
}
delay
(
100
);
delay
(
100
);
if
(
sensors
[
i
].
psensor
->
begin
(
sensors
[
i
].
id
,
false
,
sensors
[
i
].
pwire
,
if
(
sensors
[
i
].
psensor
->
begin
(
sensors
[
i
].
id
,
false
,
sensors
[
i
].
pwire
,
sensors
[
i
].
sensor_config
))
sensors
[
i
].
sensor_config
))
...
@@ -105,15 +107,15 @@ private:
...
@@ -105,15 +107,15 @@ private:
Adafruit_VL53L0X
tof4
;
Adafruit_VL53L0X
tof4
;
Adafruit_VL53L0X
tof5
;
Adafruit_VL53L0X
tof5
;
sensorList_t
sensors
[
TOFS
]
=
sensorList_t
sensors
[
TOFS
_COUNT
]
=
{
{
{
&
tof1
,
&
Wire
,
TOF_ADDRESSES
[
0
],
TOF_XSHUTS
[
0
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof1
,
&
Wire
,
TOF_ADDRESSES
[
0
],
TOF_XSHUTS
[
0
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof2
,
&
Wire
,
TOF_ADDRESSES
[
1
],
TOF_XSHUTS
[
1
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof2
,
&
Wire
,
TOF_ADDRESSES
[
1
],
TOF_XSHUTS
[
1
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof3
,
&
Wire
,
TOF_ADDRESSES
[
2
],
TOF_XSHUTS
[
2
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof3
,
&
Wire
,
TOF_ADDRESSES
[
2
],
TOF_XSHUTS
[
2
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof4
,
&
Wire
,
TOF_ADDRESSES
[
3
],
TOF_XSHUTS
[
3
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof4
,
&
Wire
,
TOF_ADDRESSES
[
3
],
TOF_XSHUTS
[
3
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
},
{
&
tof5
,
&
Wire
,
TOF_ADDRESSES
[
4
],
TOF_XSHUTS
[
4
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
}};
{
&
tof5
,
&
Wire
,
TOF_ADDRESSES
[
4
],
TOF_XSHUTS
[
4
],
Adafruit_VL53L0X
::
VL53L0X_SENSE_HIGH_SPEED
,
0
,
0
}
};
const
int
COUNT_SENSORS
=
sizeof
(
sensors
)
/
sizeof
(
sensors
[
0
]);
};
};
#endif
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment