diff --git a/demo/c/hello-C.c b/demo/c/hello-C.c index ac85376..91fff91 100644 --- a/demo/c/hello-C.c +++ b/demo/c/hello-C.c @@ -2,6 +2,7 @@ #include int main(int argc, char **argv) { + // Display a friendly message on the RCX screen cputc_native_user(CHAR_H, CHAR_E, CHAR_PARALLEL, CHAR_O); // HELLO sleep(1); cputc_native_user(CHAR_L, CHAR_E, CHAR_G, CHAR_O); //LEGO @@ -9,5 +10,16 @@ int main(int argc, char **argv) { cls(); sleep(1); + // Use different methods and display the same message upside down + cputc_hex_4(0x00); + cputc_native_3(CHAR_PARALLEL); + cputc_hex(0x03, 2); + cputc_hex(0x04, 1); + sleep(1); + cputw(0x0937); + sleep(1); + cls(); + sleep(1); + return 0; } diff --git a/include/conio.h b/include/conio.h index 49e8094..4b37dc2 100644 --- a/include/conio.h +++ b/include/conio.h @@ -232,8 +232,6 @@ extern void cputc_native_3(char mask); extern void cputc_native_4(char mask); //! write bit-pattern for segments at position 5 of LCD extern void cputc_native_5(char mask); -//! write bit-pattern for segments in positions 4 through 1 of the LCD (the main user portion) -extern void cputc_native_user(char mask_left, char mask_lcenter, char mask_rcenter, char mask_right); //! Set/Clear individual segments at specified position of LCD /*! (this is essentially a dispatcher for cputc_native_[0-5] functions) @@ -243,6 +241,10 @@ extern void cputc_native_user(char mask_left, char mask_lcenter, char mask_rcent */ extern void cputc_native(char mask, int pos); +//! write bit-pattern for segments in positions 4 through 1 of the LCD (the main user portion) +extern void cputc_native_user(char mask_left, char mask_lcenter, char mask_rcenter, char mask_right); + + //! write HEX digit to position 0 of LCD extern inline void cputc_hex_0(unsigned nibble) { @@ -280,7 +282,7 @@ extern inline void cputc_hex_5(unsigned nibble) * \param pos the location at which to display the HEX digit * \return Nothing */ -extern inline void cputc_hex(char c, int pos) +extern inline void cputc_hex(unsigned nibble, int pos) { cputc_native(get_hex_display_code(nibble), pos); } @@ -288,6 +290,7 @@ extern inline void cputc_hex(char c, int pos) //! Write a HEX word to LCD extern void cputw(unsigned word); + #ifdef CONF_ASCII //! write ASCII char to position 0 of LCD extern inline void cputc_0(unsigned c)