//#include <viewpac.h>
#include "..\..\lib\vh2k.h"
#include "..\..\lib\vp2k_lcd.h"
void main()
{
    int x=0,y=0;
    int GetChar1;

    InitLib();
    LCD_Init();
    LCD_Gotoxy(0,0);
    LCD_SetCursor(1);
    LCD_BlinkCursor(1);
    LCD_Puts("Use the direction key to move cursor.",0);
    LCD_PutsAt(0,3,"F6 : Quit",1);
    LCD_Gotoxy(0,0);

    while(1)
    {
        LCD_DisplayCursor();
        if(IsKey())
        {
            GetChar1 =ReadKey();
            if(GetChar1 == RIGHT_KEY) x++;
            else if(GetChar1 == LEFT_KEY) x--;
            else if(GetChar1 == DOWN_KEY) y++;
            else if(GetChar1 == UP_KEY) y--;
            if (x < 0) x = 0;
            else if (x > 15) x = 15;
            if (y < 0) y = 0;
            else if(y > 3) y = 3;
            LCD_Gotoxy(x,y);
        }
        if (GetChar1 == F6_KEY) 
        {
            LCD_Clear();
            StopOutWave1();
            return ;
        }
    }
} 
