Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Calibratio
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
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
LuFG VR VIS
VR-Group
Unreal-Development
Tools
Calibratio
Commits
05df50e7
Commit
05df50e7
authored
5 years ago
by
Sebastian Pape
Browse files
Options
Downloads
Patches
Plain Diff
Added Timeout and store result in Microseconds
parent
74c3c429
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
MotionToPhotonMeter.ino
+7
-1
7 additions, 1 deletion
MotionToPhotonMeter.ino
with
7 additions
and
1 deletion
MotionToPhotonMeter.ino
+
7
−
1
View file @
05df50e7
...
@@ -31,6 +31,7 @@ int zeroValueForServo = 0;
...
@@ -31,6 +31,7 @@ int zeroValueForServo = 0;
unsigned
int
deflection
=
10
;
unsigned
int
deflection
=
10
;
long
startTime
=
-
1
;
long
startTime
=
-
1
;
int
triggerValue
=
2500
;
int
triggerValue
=
2500
;
#define Timeout 10000000L
unsigned
int
requested_measurements
=
-
1
;
unsigned
int
requested_measurements
=
-
1
;
Status
current_status
=
Status
::
Ready
;
Status
current_status
=
Status
::
Ready
;
InternalStatus
current_internal_status
=
InternalStatus
::
NotZeroed
;
InternalStatus
current_internal_status
=
InternalStatus
::
NotZeroed
;
...
@@ -69,7 +70,7 @@ void core1( void * pvParameters ){
...
@@ -69,7 +70,7 @@ void core1( void * pvParameters ){
if
(
current_internal_status
==
InternalStatus
::
Stopping
if
(
current_internal_status
==
InternalStatus
::
Stopping
&&
getPhotoDiodeReading
()
<
triggerValue
){
&&
getPhotoDiodeReading
()
<
triggerValue
){
result_buffer
[
result_number
]
=
(
micros
()
-
startTime
)
/
1000.0
;
result_buffer
[
result_number
]
=
micros
()
-
startTime
;
Serial
.
println
(
"Time: "
+
String
(
result_buffer
[
result_number
]));
Serial
.
println
(
"Time: "
+
String
(
result_buffer
[
result_number
]));
result_number
++
;
result_number
++
;
current_internal_status
=
InternalStatus
::
NotZeroed
;
current_internal_status
=
InternalStatus
::
NotZeroed
;
...
@@ -80,6 +81,11 @@ void core1( void * pvParameters ){
...
@@ -80,6 +81,11 @@ void core1( void * pvParameters ){
requested_measurements
=
-
1
;
requested_measurements
=
-
1
;
}
}
}
}
// Timeout
if
(
current_internal_status
==
InternalStatus
::
Stopping
&&
(
micros
()
-
startTime
)
>
Timeout
){
current_internal_status
=
InternalStatus
::
NotZeroed
;
}
}
}
}
}
...
...
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