Commit ea35408d authored by Lisa Marie Dreier's avatar Lisa Marie Dreier
Browse files

bessere Interpolation bei nicht-gedruecktem Knopf

parent 69bef34f
......@@ -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 > 2500) {
if(input_adc > 2750) {
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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment