Commit 9403ad41 authored by Werner Sembach's avatar Werner Sembach
Browse files

Remove hello world code

parent 73b35e21
......@@ -114,51 +114,22 @@ void get_degree() {
neigung_zu_lang_rad / M_PI, neigung_zu_lang_deg);
}
#define PWM_TIMER_TICKS_PER_MICROSECOND 84
void test_thread(cyg_addrword_t arg) {
test_init();
while (1) {
uint16_t input_adc = read_adc_naiive(11);
while (!BSP_PB_GetState(BUTTON_KEY)) {
uint16_t istwert = read_adc_naiive(11);
ezs_printf("ADC: %5d ", input_adc);
if (input_adc < 500 || input_adc > 3500) {
if (istwert < 500 || istwert > 3500) {
ezs_printf("Speed: %3d\n", 0);
dc_set(0, 0);
}
else {
uint8_t speed = input_adc / 4096.0 * 125;
} else {
uint8_t speed = istwert / 4096.0 * 125;
ezs_printf("Speed: %3d\n", speed);
dc_set(DC_LEFT, speed);
}
}
/*int i = 0;
while (!BSP_PB_GetState(BUTTON_KEY)) {
for (i = 0; i < 255; i += 5) {
ezs_printf("Iteration up: %d\n", i);
dc_set(DC_RIGHT, i);
ezs_printf("Button state: %d\n", button_get());
servo_set(SERVO_0, button_get()*255);
cyg_thread_delay(250);
uint16_t input_adc = read_adc_naiive(11);
ezs_printf("adc: %d\n", input_adc);
}
for (i = 255; i > 0; i -= 5) {
ezs_printf("Iteration down: %d\n", i);
dc_set(DC_RIGHT, i);
ezs_printf("Button state: %d\n", button_get());
servo_set(SERVO_0, button_get()*255);
cyg_thread_delay(250);
uint16_t input_adc = read_adc_naiive(11);
ezs_printf("adc: %d\n", input_adc);
}
}*/
}
void cyg_user_start(void) {
......
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