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
0757569d
Commit
0757569d
authored
Jan 25, 2022
by
Orhan-Timo Altan
Browse files
Options
Downloads
Patches
Plain Diff
Mit 5 ToFs getestet
parent
a9e4d8e1
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
examples/tof_array/tof_array.ino
+14
-1
14 additions, 1 deletion
examples/tof_array/tof_array.ino
tof_array.h
+7
-3
7 additions, 3 deletions
tof_array.h
with
22 additions
and
5 deletions
README.md
+
1
−
1
View file @
0757569d
...
...
@@ -4,7 +4,7 @@ Diese Bibliothek verwendet die Adafruit_VL53L0X Bibliothek um einen Array mit me
Getestet mit:
-
Arduino Mega Pro +
3
x VL53L0X
<br
/>
-
Arduino Mega Pro +
5
x VL53L0X
<br
/>
<br
/>
## **Vorrausetzung**
...
...
This diff is collapsed.
Click to expand it.
examples/tof_array/tof_array.ino
+
14
−
1
View file @
0757569d
...
...
@@ -11,6 +11,19 @@ void setup() {
void
loop
()
{
get_tof_distance
(
0
);
int
test
=
get_tof_distance
(
0
);
int
test2
=
get_tof_distance
(
1
);
int
test3
=
get_tof_distance
(
2
);
int
test4
=
get_tof_distance
(
3
);
int
test5
=
get_tof_distance
(
4
);
Serial
.
print
(
test
);
Serial
.
print
(
" "
);
Serial
.
print
(
test2
);
Serial
.
print
(
" "
);
Serial
.
print
(
test3
);
Serial
.
print
(
" "
);
Serial
.
print
(
test4
);
Serial
.
print
(
" "
);
Serial
.
println
(
test5
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tof_array.h
+
7
−
3
View file @
0757569d
...
...
@@ -14,8 +14,9 @@
const
int
ToFs
=
5
;
// Anzahl der zu Verwendenden Time of Flight Sensoren
const
int
ToF_XShuts
[
ToFs
]
=
{
NULL
,
9
,
11
,
31
,
A10
};
// 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
int
tof_dist
;
#define DEBUG
//
#define DEBUG
#ifdef DEBUG
#define _println_(x) Serial.println(x)
#define _print_(x) Serial.print(x)
...
...
@@ -81,17 +82,20 @@ void tof_init() {
}
}
void
get_tof_distance
(
int
i
){
int
get_tof_distance
(
int
i
){
VL53L0X_RangingMeasurementData_t
measure
;
sensors
[
i
].
psensor
->
rangingTest
(
&
measure
,
false
);
// 'true' um debug Informationen auszugeben
if
(
measure
.
RangeStatus
!=
4
)
{
// phase failures have incorrect data
tof_dist
=
measure
.
RangeMilliMeter
/
10
;
_print_
(
i
);
_print_
(
" Sensor Entfernung (cm): "
);
_println_
(
measure
.
RangeMilliMeter
/
10
);
_println_
(
tof_dist
);
}
else
{
_println_
(
" Ausserhalb des Messbereichs "
);
tof_dist
=
0
;
}
return
tof_dist
;
}
#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