Modules | Functions

Functions which handle the display. More...

Modules

 Advanced informations
 

Functions

void lcdout (uint8_t data)
 Writes one byte to the display. More...
 
void lcdstr (const char *send_data)
 Writes a string located in the RAM to the display. More...
 
void lcdstr_p (const char *send_data)
 Writes a string located in the flash to the display. More...
 
void lcdclr (void)
 Clears the display. More...
 
void lcdxy (uint8_t x, uint8_t y)
 Moves the cursor to a postion on the display. More...
 

Additional Functions (printf-style)

void lcdfout (const char *format,...)
 Display formated text. More...
 

Detailed Description

Functions which handle the display.

Function Documentation

◆ lcdclr()

void lcdclr ( void  )

◆ lcdfout()

void lcdfout ( const char *  format,
  ... 
)

Display formated text.

To use this function, include tucbot_additionals/fout.h into your code.

#include <tucbot_additionals/fout.h>

int main(void) {

    init_tucbot(0xFF);
    battery_request(kRequestWait);

    while (1) {
        lcdclr();
        lcdfout("V=%d",battery_get());
        mdelay(1000);
    }
}
Parameters
formatFormat string.
String description
%c Output of an unsigned 8-bit value
%i Output of short (16-bit)
%li Output of long int (32-bit)
%s Output of character string
%x Output an unsigned int/short in hex style
...For each place holder, a variable has to be added as parameter of the function
Note
As this function uses printf functions and their variants, the generated microcontroller code will grow in size. Especially, if floating point values are to be printed out. For this reason, floating point formating is disabled by default within the makefile (see PRINTF_LIB).
The display shows only 2*16 characters. Switching to the next line has to be done manually with lcdxy(0,1).
See also
lcdstr_p() and lcdout()

◆ lcdout()

void lcdout ( uint8_t  data)

◆ lcdstr()

void lcdstr ( const char *  send_data)

Writes a string located in the RAM to the display.

This function loads the referenced string character by character and writes those using the lcdout() function until a terminating \ 0-character is found.

Parameters
*send_data16-bit pointer to a character located in the RAM
See also
lcdstr_p(), lcdout(), lcdxy() and lcdclr()

◆ lcdstr_p()

void lcdstr_p ( const char *  send_data)

Writes a string located in the flash to the display.

This function loads the referenced string character by character and writes those using the lcdout() function until a terminating \ 0-character is found.

Parameters
*send_data16-bit pointer to a character located in the flash
See also
lcdstr(), lcdout(), lcdxy() and lcdclr()
Examples
battery.c, beeper.c, bumper.c, cyclic.c, driveAdjust.pupil.c, driveAngle.pupil.c, driveArc.pupil.c, driveDist.pupil.c, encoderComplex.c, encoderSimple.c, imu.c, lausTracker.c, lineComplex.c, lineSimple.c, mode.c, motorComplex.c, motorSimple.c, packedCom.c, remoteControl.c, servo.c, sharp.c, tsop.c, twi.c, and uart.c.

◆ lcdxy()

void lcdxy ( uint8_t  x,
uint8_t  y 
)

Moves the cursor to a postion on the display.

The column is set by the x parameter and can be between 0 and 15.
The row is set by the y parameter and can be between 0 and 1.

Parameters
x8-bit unsigned integer (0..15)
0 is the most left character.
15 is the most right character.
y8-bit integer. (0..1)
0 is the upper line.
1 is the lower line.
See also
lcdout(), lcdstr() and lcdclr()
Examples
battery.c, beeper.c, bumper.c, cyclic.c, driveAdjust.pupil.c, driveAngle.pupil.c, driveArc.pupil.c, driveDist.pupil.c, encoderComplex.c, encoderSimple.c, imu.c, lausTracker.c, lineComplex.c, lineSimple.c, mode.c, motorComplex.c, motorSimple.c, packedCom.c, remoteControl.c, servo.c, sharp.c, tsop.c, twi.c, and uart.c.