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
ea35408d
Commit
ea35408d
authored
Jul 25, 2017
by
Lisa Marie Dreier
Browse files
bessere Interpolation bei nicht-gedruecktem Knopf
parent
69bef34f
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.c
View file @
ea35408d
...
...
@@ -197,6 +197,7 @@ void test_thread(cyg_addrword_t arg) {
ezs_printf
(
"adc: %3d
\n
"
,
input_adc
);
button_state
=
button_get
();
double
max_degree
=
get_max_degree
();
ezs_printf
(
"max_degree: %3d
\n
"
,
max_degree
);
if
(
max_degree
>
90
)
upside_down
=
true
;
...
...
@@ -207,11 +208,16 @@ void test_thread(cyg_addrword_t arg) {
ueberdreht
=
motor_on
(
input_adc
);
}
else
{
if
(
input_adc
>
25
0
0
)
{
if
(
input_adc
>
2
7
50
)
{
uint8_t
speed
=
250
;
//input_adc / 4096.0 * 125; //max: 106
ezs_printf
(
"Speed: %3d
\n
"
,
speed
);
dc_set
(
DC_RIGHT
,
speed
);
}
if
(
input_adc
>
2500
&&
input_adc
<
2750
)
{
uint8_t
speed
=
input_adc
-
2500
;
//input_adc / 4096.0 * 125; //max: 106
ezs_printf
(
"Speed: %3d
\n
"
,
speed
);
dc_set
(
DC_RIGHT
,
speed
);
}
else
{
dc_set
(
0
,
0
);
}
...
...
@@ -221,6 +227,7 @@ void test_thread(cyg_addrword_t arg) {
if
(
button_state
&&
ueberdreht
&&
upside_down
)
{
//Problem solved
ezs_printf
(
"CONGRATULATIONS! YOU FINALLY MADE IT
\n
"
);
servo_set
(
SERVO_0
,
button_get
()
*
200
);
cyg_thread_delay
(
250
);
}
...
...
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