WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

_display_common.h

Defines all of the commands that are common to all displays.
This file is automatically included once you include the header file for the actual display you are using.

 

Function

 


displayInit(DISPLAY* display)

Initialise the display prior to use.
This should be called from your appInitHardware. If you are using Project Designer then this will be automatically generated for you.

DISPLAY_COLUMN displayColumns(const DISPLAY* display)

Returns the maximum number of columns, ie characters, across the display.

DISPLAY_LINE displayLines(const DISPLAY* display)

Returns the maximum number of character lines down the diplay.

Writer displayGetWriter(const DISPLAY* display)

Returns a Writer that can be used to send rprintf output to the display.
For example: assuming we have defined a display called 'display' and we want to send the message 'Hello World' to it then we can write:
// Redirect rprintf to the display
Writer old = rprintfInit( displayGetWriter(&display) );
rprintf("Hello World\n");
// Restore rprintf to go to its original position
rprintfInit(old);

displayClear(DISPLAY* display)

Clear the display ie fill it with spaces.

displayHome(DISPLAY* display)

Move the cursor to the top left corner of the display.

displayGoto(DISPLAY* display, DISPLAY_COLUMN x, DISPLAY_LINE y)

Move the cursor to the specified column and line.
Both numbers start at 0 so displayHome is the same as using this command to go to 0,0.
If you attempt to move the cursor outside of the possible display area then the cursor will wrap around so that it is always within the display area.

displayLineWrap(DISPLAY* display,boolean on)

Turn automatic line wrapping on or off.
If line wrapping is turned on then if the cursor goes off the right side of the display then it will wrap around to the start of the next line.
If line wrapping is turned off then any characters beyond the end of the display are discarded.
The default setting is that line wrapping is turned off.

displayAutoScroll(DISPLAY* display,boolean on)

Turn auto-scrolling on or off.
This setting dictates what happens when the cursor moves passed the bottom of the display:
If auto-scrolling is turned on then the contents of the screen are scrolled up one line and previous contents of the top line are lost. The cursor will remain on the bottom line which is now blank.
If auto-scrolling is turned off then the cursor will wrap around to the top of the display and the current contents of the display will remain unchanged.
The default setting is that auto-scrolling is turned off.

displayBacklight(DISPLAY* display,boolean on)

Turn the display back light on or off (assuming that it has one and that it can be controlled in software).
The default setting is that the backlight is turned off - to save battery power.

displayBrightness(DISPLAY* display,uint8_t percent)

Set the brightness of the display to a number between 0 (darkest) and 100 (brightest).
If your display cannot control the brightness via software then this command is ignored.

displayContrast(DISPLAY* display,uint8_t percent)

Set the contrast of the display to a number between 0 (least) and 100 (most).
If your display cannot control the contrast via software then this command is ignored.

uint8_t displaySendByte(DISPLAY* display,uint8_t byte)

Send a character, or command byte, to the display.
Normally display output is achieved using rprintf - but this command may be used to create a Writer to send data to the display:-
MAKE_WRITER(display_put_char){
    return displaySendByte(&display,byte);
}
Project Designer will create this code for you automatically.

displayHorizGraph(DISPLAY* display, DISPLAY_COLUMN x, DISPLAY_LINE y, uint16_t val, uint16_t max, uint8_t count)

Draws a horizontal bar graph on the display.
The x,y parameters specify the start location of the left side of the graph.
The val parameter specifies the value for the bar and should be between 0 and 'max'
The max parameter specifies the maximum value that can be shown
The count parameter specifies how many characters are to be used across the display for a single bar.
NB The Sparkfun serLCD product does not allow the use of custom characters - so the graph is very low resolution.

displayVertGraph(DISPLAY* display, DISPLAY_COLUMN x, DISPLAY_LINE y, uint16_t val, uint16_t max, uint8_t count)

Draws a vertical bar graph on the display.
The x,y parameters specify the start location of the bottom left of the graph.
The val parameter specifies the value for the bar and should be between 0 and 'max'
The max parameter specifies the maximum value that can be shown
The count parameter specifies how many characters are to be used up the display for a single bar.
NB The Sparkfun serLCD product does not allow the use of custom characters - so the graph is very low resolution.

Valid XHTML 1.0 Transitional