LCD

CCSのPICCでLCD表示をしたいと思った。
古い書籍ではLCD.cについての解説がなかったのでインターネットで探した。
K.Iさんの「http://bluefish.orz.hm/sdoc/pic_ccp.html#LCDってどうやって使うの」
というページでLCD.c内に関数の説明がコメントで書いてあることを知る。
 
以下の順で記述するとできた。
 
まず、LCDとPICとのピン接続を定義する。
<例:自分がやったPIC18F2550の場合>
    #define LCD_power           PIN_B0
    #define LCD_RS_PIN         PIN_B1
    #define LCD_RW_PIN        PIN_B2
    #define LCD_ENABLE_PIN  PIN_B3
    #define LCD_DATA4         PIN_B4
    #define LCD_DATA5         PIN_B5
    #define LCD_DATA6         PIN_B6
    #define LCD_DATA7         PIN_B7
 
次に、 lcd_init(); とかく。使用するBポートの設定やLCDの初期設定をやってくれる。
 
あとは、自分の表示したい事を以下の関数を利用してやる。
lcd_putc(c)  Will display c on the next position of the LCD. //使用例 lcd_putc("test");
              \a  Set cursor position to upper left                 //使用例 lcd_putc("\atest");とするとLCDの左
              \f  Clear display, set cursor to upper left          //上端に「test」と表示される。
              \n  Go to start of second line                        //
              \b  Move back one position                           //
////              If LCD_EXTENDED_NEWLINE is defined, the \n character     ////
////              will erase all remanining characters on the current      ////
////              line, and move the cursor to the beginning of the next   ////
////              line.                                                    ////
////              If LCD_EXTENDED_NEWLINE is defined, the \r character     ////
////              will move the cursor to the start of the current         ////
////              line.                             
                       ////
↑自分には意味が分かりません。
 
 
lcd_gotoxy(x,y) Set write position on LCD (upper left is 1,1)        //カーソルの位置を変更できる。
                                          //上左端 lcd_gotoxy(1,1);
                                          //下左端 lcd_gotoxy(2,16);

                                                                     
lcd_getc(x,y)   Returns character at position x,y on LCD         //指定されたカーソル位置の文字データを取得