I kindly need help with displaying a digital clock on a powertip pc1602f b 16x2 LCD display module, the code works well but I need to be able to run it atmel studio 7... I am using STK300 AVR Board and the time displayed on the lcd screen. The program should ideally be in c/embedded c
/*
* A1.c
*
* Created: 19/10/2018 11:51:29
* Author : mk3101f
*/
#include <stdio.h>
#include <time.h> //for sleep() function
int main(void)
{
int hour, minute, second;
hour=minute=second=0;
while (1)
{
//clear output screen
system("clear");
//print time in HH : MM : SS format
printf("%02d : %02d : %02d ",hour,minute,second);
//clear output buffer in gcc
fflush(stdout);
//increase second
second++;
//update hour, minute and second
if(second==60){
minute+=1;
second=0;
}
if(minute==60){
hour+=1;
minute=0;
}
if(hour==24){
hour=0;
minute=0;
second=0;
}
sleep(1); //wait till 1 second
}
return 0;
}