Beispiel #1
0
int main()
{

	//specifies the pins that will be used
	int selectedPins[]={P8_14,P8_12,P8_11,P9_15,P9_13,P9_12};
	//adding a simple description for each pin
	const char *pinDescription[] = {"DB7","DB6","DB5","DB4","RS","E"};

	struct gpioID enabled_gpio[6];    

    initialize_Screen(enabled_gpio,selectedPins);	
	
	//clear screen
	clear_Screen(enabled_gpio);

	//types "hi!" to the screen
	stringToScreen("Connected to web server!",enabled_gpio);

	//go to the bottom line and write something else
	//note: goto_ScreenLine(0,enabled_gpio) will go to the top line.
	goto_ScreenLine(1,enabled_gpio);
	stringToScreen("temperature and humidity!",enabled_gpio);

	//really... don't forget to terminate the screen
    terminate_Screen(enabled_gpio,selectedPins);

	return 1;
}
int main()
{
    //specifies the pins that will be used
    int selectedPins[]= {P8_14,P8_12,P8_11,P8_5,P8_4,P8_3};
    const char *pinDescription[] = {"DB7","DB6","DB5","DB4","RS","E"};

    int i;
    struct gpioID enabled_gpio[6];

    //initialized the screen
    initialize_Screen(enabled_gpio,selectedPins);

    //clear the screen from everything that may be in there

    for (i=65; i<122; i++)
    {
        //type every single character  characters
        clear_Screen(enabled_gpio);
        charToScreen((char)i,enabled_gpio);
        sleep(1);
    }
    //this instruction must be added or the LCD may not work as expected next
    //time... unless you reboot it.
    terminate_Screen(enabled_gpio,selectedPins);

}