Send counter output to LCD
Hello, I’m new to C, and I have written the following code, I didn’t include the forward declarations, or the functions as they are not in question. I’m trying to send a counter (every 1 sec) to a LCD.
The code I wrote will send “this is line 2” to the LCD. If I could put a variable in place of ‘this is line 2’, that would solve the problem, but I guess that’s not possible. I can’t think up a way to send the counter to the LCD. I’m working in C code. Any thoughts?
code:
Code:
for(int c = 0; c <=10000; c++) //This is any counter
{
Pause(1);
} //end counter
/* I want to send the output of the counter (or any A/D output) to the LCD*/
line2(); //Sends to LCD line 2
char a[25] = " this is line 2 "; // Initialize the array
for(int i = 0; i < 20; i++) // Count i from 0 to 20
{
pause(2); //wait 2mS
data(); //tell LCD data follows
set_outputs (0,7, (a[i])); //Send (output) LINE 2 to data bus pins 0-7 (8bit)
pause(TW); //wait about 1 mS