LCD4884 counting example

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)

Related posts

Arduino Uno and PCT2075 temperature sensor

Arduino Uno and AHT20 Integrated temperature and humidity Sensor

Arduino Uno and LTR390 UV Light Sensor

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More