Home Code LCD4884 counting example

LCD4884 counting example

by shedboy71
[lebox id="1"]

A simple example to count to 10000 and display this on an LCD4884 shield
Code

[c]

#include “LCD4884.h”

#define MENU_X  10      // 0-83
#define MENU_Y  1       // 0-5

int counter = 0;
char string[10];

void setup()
{

lcd.LCD_init();
lcd.LCD_clear();

init_MENU();
}

void init_MENU(void)
{

byte i;
lcd.LCD_clear();
lcd.LCD_write_string(MENU_X, MENU_Y, “Counter”, MENU_HIGHLIGHT );
}

void loop()
{

if(++counter < 10000)
{
itoa(counter,string,10);
lcd.LCD_write_string(MENU_X, MENU_Y + 1, string, MENU_NORMAL);
}
else
{
counter = 0,init_MENU();
}
delay(10);

}

[/c]

Links

 
Graphic LCD4884 Shield for (For Arduino)

Share
[lebox id="2"]

You may also like