#include <tucbot/tucbot.h>
#include <tucbot_additionals/packedCom.h>
#include <tucbot_additionals/remoteControl.h>
void testRemoteControl(void);
int main(void);
void testRemoteControl(void) {
uint8_t menu_pos = 0;
uint8_t flag_redraw_menu = 0xFF;
uint8_t value_active = 0xFF;
uint8_t value_count = 0;
uint8_t temp;
while (1) {
if (flag_redraw_menu) {
flag_redraw_menu = 0x00;
if (menu_pos == 0) {
} else {
}
}
if (menu_pos == 0) {
menu_pos = 1;
} else {
menu_pos = 0;
#ifdef TUCBOT_PUPIL
#endif // #ifdef TUCBOT_PUPIL
}
flag_redraw_menu = 0xFF;
if (value_active) {
value_active = 0x00;
if (menu_pos == 1) {
#ifdef TUCBOT_PUPIL
#endif // #ifdef TUCBOT_PUPIL
}
} else {
value_active = 0xFF;
}
}
if (temp != value_count) {
value_count = temp;
}
if (menu_pos == 0) {
if (value_active) {
cli();
sei();
}
}
} else {
if (value_active) {
#ifdef TUCBOT_PUPIL
#endif // #ifdef TUCBOT_PUPIL
}
}
}
#ifndef TUCBOT_PUPIL
if (value_active && menu_pos) {
}
#endif // #ifdef TUCBOT_PUPIL
}
}
int main (void) {
testRemoteControl();
return (0);
}
void leds_set(eLedMask bitmask, uint8_t bool)
Sets the selected leds on or off.
@ kRemoteControlGetMotorRight
constant (2): right motor power in percent (8-bit)
Definition: remoteControl.h:126
@ kModeStudent
constant (1): robot is in student mode
Definition: mode.h:31
int16_t remoteControl_get(eRemoteControlGet select)
Returns the last stored version of the selected value.
@ kMotorSetAll
bit mask (0x03): both motors
Definition: motors.h:47
@ kMotorSetRight
bit mask (0x02): right motor
Definition: motors.h:45
@ kLedOn
constant (0xFF): turn leds on
Definition: leds.h:63
@ kLedRight
bit mask (0x04): right led
Definition: leds.h:46
@ kRemoteControlSelectAll
bit mask (0x03): select all data blocks
Definition: remoteControl.h:114
@ kModePupil
constant (0): robot is in pupil mode
Definition: mode.h:29
@ kRemoteControlSelectMotor
Definition: remoteControl.h:111
void int16tostr(void *out, int16_t number, uint8_t digits)
Converts an integer to a string and passes it to an output function.
@ kRemoteControlSelectTwist
Definition: remoteControl.h:108
@ 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
void uint16tostr(void *out, uint16_t number, uint8_t digits)
Converts an unsigned integer to a string and passes it to an output function.
void packedCom_activate(void)
Turns the reception of data packets on.
void lcdclr(void)
Clears the display.
eRemoteControlSelectMask remoteControl_changed(eRemoteControlSelectMask bitmask)
Indicates if new data changed the selected data blocks.
uint8_t packedCom_get(ePackedComGet select)
Returns the last stored selected value.
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.
void drive_stop(eDriveStop mode)
Lets the robot stop driving.
void motors_set(eMotorSetMask select, int8_t power)
Sets the motor power of the selected motor(s).
@ kPackedComGetPacketCount
constants (2): number of correct received packets
Definition: packedCom.h:264
@ kDriveStopNormal
constant (0): continuously decreasing the speed
Definition: drive.h:31
void remoteControl_request(eRemoteControlSelectMask bitmask, eRequestType request)
Requests new data from the remote control.
void lcdstr_p(const char *send_data)
Writes a string located in the flash to the display.
@ kMotorSetLeft
bit mask (0x01): left motor
Definition: motors.h:43
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.
@ kRemoteControlGetTwistLinear
constant (3): linear speed in mm/s (16-bit)
Definition: remoteControl.h:128
void drive_adjust(int16_t speed_distance, int16_t speed_angle)
Adjusts the robots driving.
@ kRemoteControlGetMotorLeft
constant (1): left motor power in percent (8-bit)
Definition: remoteControl.h:124
@ kRemoteControlGetTwistAngular
constant (4): angular speed in degrees/s (16-bit)
Definition: remoteControl.h:130
eLedMask leds_get(eLedMask bitmask)
Returns the current state of the selected leds.