Im C Tutorial Kapitel 8 wird gezeigt wie man die Werte der Hindernissensoren ausliest. Nach dem Aufruf von copro_update() stehen die aktuellen Werte im copro_distance Array zur Verfügung:
Komplettes Beispiel: http://www.roboter.cc/index.php?opti...t&projectid=53Code:char text[20]="-- -- -- -- --"; // Co-Prozessor if (copro_update()) { sprintf(text, "%02x %02x %02x %02x %02x", (uint16_t)copro_distance[0]/256, (uint16_t)copro_distance[1]/256, (uint16_t)copro_distance[2]/256, (uint16_t)copro_distance[3]/256, (uint16_t)copro_distance[4]/256); } gfx_move(10, 55); gfx_print_text(text);







Zitieren

Lesezeichen