#include <tucbot/tucbot.h>
void testSharp(void);
int main(void);
void testSharp(void) {
int16_t value;
uint8_t countdown = 0;
uint8_t flag_convert = 0xFF;
while (1) {
flag_convert = 0xFF;
countdown = 0;
flag_convert = 0x00;
countdown = 0;
}
if (countdown) {
countdown--;
} else {
countdown = 5;
}
}
}
int main (void) {
testSharp();
return (0);
}
void leds_set(eLedMask bitmask, uint8_t bool)
Sets the selected leds on or off.
@ kSharpGetRight
constants (3): right ir-distance sensor
Definition: sharps.h:88
@ kLedOn
constant (0xFF): turn leds on
Definition: leds.h:63
@ kLedRight
bit mask (0x04): right led
Definition: leds.h:46
void int16tostr(void *out, int16_t number, uint8_t digits)
Converts an integer to a string and passes it to an output function.
uint16_t sharps_get(eSharpGet select)
Returns the last stored value of the selected sharp sensor.
@ 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
@ kSharpGetLeft
constants (1): left ir-distance sensor
Definition: sharps.h:84
void lcdclr(void)
Clears the display.
int16_t sharps_toMm(uint16_t adc)
Converts an adc value of a sharp sensor into millimeters.
void lcdxy(uint8_t x, uint8_t y)
Moves the cursor to a postion on the display.
void sharps_request(eRequestType request)
Requests new data from the sharp sensors.
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.
@ kSharpGetMiddle
constants (2): middle ir-distance sensor
Definition: sharps.h:86