Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Werner Sembach
Ainigma
Commits
7b79c157
Commit
7b79c157
authored
Sep 07, 2017
by
Werner Sembach
Browse files
Cleanup
parent
056604a9
Changes
1
Show whitespace changes
Inline
Side-by-side
src/Util.cpp
View file @
7b79c157
...
...
@@ -128,7 +128,7 @@ extern "C" bool simulate_spring(struct spring springs[], int len) {
uint16_t
adc_value
=
adc_get
(
11
);
for
(
int
i
=
0
;
i
<
len
;
i
++
){
//
ezs_printf("%d\n", adc_value);
//
ezs_printf("%d\n", adc_value);
if
(
adc_value
<
springs
[
i
].
threshold
){
if
(
springs
[
i
].
power
<
0
){
if
(
springs
[
i
].
direction
==
'l'
){
...
...
@@ -148,31 +148,12 @@ extern "C" bool simulate_spring(struct spring springs[], int len) {
dc_set
(
0
,
0
);
}
}
return
springs
[
i
].
solved
;
}
}
// in case no threshold is "reached" (e.g. the struct params are faulty)
// the box shouldn't be unopenable then
return
true
;
/*old stuff without params:
if (adc_value < 256) {
//potty protection deadzone
dc_set(0, 0);
}
else if(adc_value > (4096 - 256)) {
//spring is "broken"
dc_set(0, 0);
return true;
}
else {
//main simulation
dc_set(DC_RIGHT, adc_value / 4096.0 * 255);
}
return false;
*/
}
// turns the motor real fast if above certain position
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment