Display

#include <conio.h>
#includ <dlcd.h>

This section is a reference for all commands related to controlling the LCD panel.

Display positions
Digit display positions are denumerated from right to left, starting with 0 for the digit to the right of the running man. Digit 5 is only partially present on the RCXs display.
Native segment masks
In these bitmasks, bit 0 toggles the middle segment. Bit 1 toggles the top right segment, and the remaining segments are denumerated counterclockwise. The dot isn't encoded.


void cls ( );
Clear the user portion of screen

void cputs ( char * s );
Display an ASCIIZ string, only the first 5 characters will be displayed. if there are less than 5 characters, the remaining display positions will be cleared
Parameters: s - the string to be displayed

void cputw ( unsigned word );
Display a hexword, position 0 not used
Parameters: word - the word the be displayed

void cputc_hex_X ( unsigned nibble c );
Displays a hex value in position X
Parameters: c - the value to be displayed

void lcd_int ( int i );
Displays an integer on the LCD screen. Position 0 not used.
Parameters: i - the integer to be displayed

void lcd_unsigned ( unsigned int u );
Displays an unsigned integer value in decimal.
Parameters: i - the unsigned integer to be displayed

void lcd_digit ( int i );
displays a digit at position 0
Parameters: i - the digit to be displayed

void lcd_clock ( int i );

Parameters: i - will be displayed with the format XX:XX

void number ( int i, lcd_number_style n, lcd_comma_style c );
fancy number display
Number Style: digit, sign, unsign
Comma Style: e0, e_1, e_2, e_3
Parameters: i - the integer to be shown
n the number style
c the comma style

void lcd_hide ( char mask );

void lcd_show ( char mask );
hide and show the specified LCD segments
Parameters: mask, see below -
  • LCD mask definitions
  • LCD_0_BOT, LCD_0_BOTL, LCD_0_BOTR, LCD_0_MID, LCD_0_TOP, LCD_0_TOPL, LCD_0_TOPR
  • LCD_1_BOT, LCD_1_BOTL, LCD_1_BOTR, LCD_1_MID, LCD_1_TOP, LCD_1_TOPL, LCD_1_TOPR
  • LCD_2_BOT, LCD_2_BOTL, LCD_2_BOTR, LCD_2_MID, LCD_2_TOP, LCD_2_TOPL, LCD_2_TOPR
  • LCD_3_BOT, LCD_3_BOTL, LCD_3_BOTR, LCD_3_MID, LCD_3_TOP, LCD_3_TOPL, LCD_3_TOPR
  • LCD_4_BOT, LCD_4_BOTL, LCD_4_BOTR, LCD_4_MID, LCD_4_TOP, LCD_4_TOPL, LCD_4_TOPR
  • LCD_5_MID
  • LCD_2_DOT, LCD_3_DOT, LCD_4_DOT
  • LCD_A_LEFT, LCD_A_RIGHT, LCD_A_SELECT
  • LCD_B_LEFT, LCD_B_RIGHT, LCD_B_SELECT
  • LCD_C_LEFT, LCD_C_RIGHT, LCD_C_SELECT
  • LCD_CIRCLE_0, LCD_CIRCLE_1, LCD_CIRCLE_2, LCD_CIRCLE_3
  • LCD_BATTERY_X
  • LCD_ARMS, LCD_1LEG, LCD_2LEGS, LCD_BODY
  • LCD_DOT_0, LCD_DOT_1, LCD_DOT_2, LCD_DOT_3, LCD_DOT_4,
  • LCD_IR_LOWER, LCD_IR_UPPER
  • LCD_EMPTY_1, LCD_EMPTY_2