#include <tucbot/tucbot.h>
void testDriveAngle_pupil(void);
int main(void);
void testDriveAngle_pupil(void) {
uint8_t menu_pos = 0;
uint8_t flag_redraw_menu = 0xFF;
while (1) {
if (flag_redraw_menu) {
flag_redraw_menu = 0x00;
switch (menu_pos) {
case 0:
lcdstr_p(PSTR(
"a= 30" "\xDF" " v= 10" "\xDF" "/s"));
break;
case 1:
lcdstr_p(PSTR(
"a= 90" "\xDF" " v= 30" "\xDF" "/s"));
break;
default:
lcdstr_p(PSTR(
"a= 360" "\xDF" " v= 90" "\xDF" "/s"));
menu_pos = 2;
break;
}
}
menu_pos++;
if (menu_pos > 2) {menu_pos = 0;}
flag_redraw_menu = 0xFF;
} else {
switch (menu_pos) {
}
while (1) {
break;
}
}
}
}
}
flag_redraw_menu = 0xFF;
}
}
}
}
int main (void) {
testDriveAngle_pupil();
return (0);
}
void leds_set(eLedMask bitmask, uint8_t bool)
Sets the selected leds on or off.
void drive_angle(int16_t angle, int16_t speed)
Lets the robot turn for an angle.
@ kDriveCommandDone
constant (0): no driving
Definition: drive.h:43
@ kLedOn
constant (0xFF): turn leds on
Definition: leds.h:63
@ kLedRight
bit mask (0x04): right led
Definition: leds.h:46
@ kDriveSelectState
Definition: drive.h:120
@ kModePupil
constant (0): robot is in pupil mode
Definition: mode.h:29
eDriveSelectMask drive_received(eDriveSelectMask bitmask)
Indicates if new data for the selected data blocks were received.
@ kDriveGetSpeedAngle
constant ( 4): current angular speed in degrees/s
Definition: drive.h:197
void drive_request(eDriveSelectMask bitmask, eRequestType request)
Requests new data from the drive module.
void int16tostr(void *out, int16_t number, uint8_t digits)
Converts an integer to a string and passes it to an output function.
eDriveSelectMask drive_changed(eDriveSelectMask bitmask)
Indicates if new data changed the selected data blocks.
int16_t drive_get(eDriveGet select)
Returns the last stored version of the selected value.
@ kDriveSelectPosition
Definition: drive.h:123
@ kLedLeft
bit mask (0x10): left led
Definition: leds.h:42
@ kRequestContinuous
constant (3): request continuous updates
Definition: update.h:37
@ kLedMiddle
bit mask (0x08): middle led
Definition: leds.h:44
@ kLedOff
constant (0x00): turn leds off
Definition: leds.h:61
@ kDriveSelectSpeed
Definition: drive.h:126
void lcdclr(void)
Clears the display.
@ kDriveGetCommand
Definition: drive.h:199
void lcdxy(uint8_t x, uint8_t y)
Moves the cursor to a postion on the display.
void mode_set(eMode mode)
Sets the mode of the TUC-Bot.
@ kDriveSelectAll
Definition: drive.h:129
void lcdstr_p(const char *send_data)
Writes a string located in the flash to the display.
void lcdout(uint8_t data)
Writes one byte to the display.
void init_tucbot(uint8_t enable_interrupts)
Initiates the TUC-Bot.
void mdelay(uint16_t mseconds)
Waits for the given time in milliseconds.
@ kDriveGetError
Definition: drive.h:202
@ kDriveGetPositionAngle
constant ( 2): turned angle in degrees
Definition: drive.h:193