#include <tucbot/tucbot.h>
void testMotor(void);
int main(void);
void testMotor(void) {
int8_t speed = 0;
while (1) {
if (speed > -100) {
speed-= 5;
}
if (speed < 100) {
speed+= 5;
}
}
}
}
}
int main (void) {
testMotor();
return (0);
}
void leds_set(eLedMask bitmask, uint8_t bool)
Sets the selected leds on or off.
@ kCurrentGetRight
constants (2): right motor current
Definition: currents.h:45
@ kModeStudent
constant (1): robot is in student mode
Definition: mode.h:31
@ kCurrentGetLeft
constants (1): left motor current
Definition: currents.h:43
@ kMotorSetAll
bit mask (0x03): both motors
Definition: motors.h:47
@ kLedOn
constant (0xFF): turn leds on
Definition: leds.h:63
@ kLedRight
bit mask (0x04): right led
Definition: leds.h:46
uint16_t currents_get(eCurrentGet select)
Returns the last stored current of the selected motor.
void int16tostr(void *out, int16_t number, uint8_t digits)
Converts an integer to a string and passes it to an output function.
uint8_t currents_changed(void)
Indicates if new data changed the data block sMD_SensCurrent.
@ 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 lcdclr(void)
Clears the display.
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 motors_set(eMotorSetMask select, int8_t power)
Sets the motor power of the selected motor(s).
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.
void currents_request(eRequestType request)
Requests new data from the motor currents.