imranshoaib
Junior Member level 2
Hi all,
The following code is suppose to do the following but it is giving an error, please help.
At start up, a string "Please Enter S-T" should show on top line of the LCD. Press and hold push button RB6 to increment the sampling time from 1 to 10 seconds shown on line 2 of the LCD. Release the pushbutton once the required sampling interval has been set. The display should roll back to 1 when it exceeds 10 seconds.
#include"io16f877.h"
#include"LCDdrive.h"
unsigned int x = 0; //declare variable "x"
void main(void)
{
LCD_initialise(); //function to initialise the lcd display
LCD_cursor(0,0); //function to move the cursor position
LCD_puts("Please Enter S-T"); //function to display a string on lcd
TRISB = 1; //define port b as inputs
while(1)
{
if(RB6==1)
{
del(3);
x++; //counter to hold the sampling time value
if(x>10)
x = 1;
}
LCD_cursor(0,1); //function to move the cursor position
LCD_display_value(x); //function to display the x value on lcd
}
}
Regards,
Imran
The following code is suppose to do the following but it is giving an error, please help.
At start up, a string "Please Enter S-T" should show on top line of the LCD. Press and hold push button RB6 to increment the sampling time from 1 to 10 seconds shown on line 2 of the LCD. Release the pushbutton once the required sampling interval has been set. The display should roll back to 1 when it exceeds 10 seconds.
#include"io16f877.h"
#include"LCDdrive.h"
unsigned int x = 0; //declare variable "x"
void main(void)
{
LCD_initialise(); //function to initialise the lcd display
LCD_cursor(0,0); //function to move the cursor position
LCD_puts("Please Enter S-T"); //function to display a string on lcd
TRISB = 1; //define port b as inputs
while(1)
{
if(RB6==1)
{
del(3);
x++; //counter to hold the sampling time value
if(x>10)
x = 1;
}
LCD_cursor(0,1); //function to move the cursor position
LCD_display_value(x); //function to display the x value on lcd
}
}
Regards,
Imran