C Code for AT89C51 with LCD1602
C Code for AT89C51 with LCD1602
#include <reg51.h>
// delay with digit multi-plexing.. char min_MSB; char min_LSB; sbit portBit = P2^0; sbit mybit=P2^1; // FUnction to convert two digit number to the resective digits for [Link] min_LSBand min_MSB..
//int number = 85; for (millisec=1;millisec <=10;millisec++) { //Turn first LED on.. P3 = min_MSB;
for(d=0;d<=1;d++) { TMOD=0x01; TL0=0xFD; TH0=0x04B; TR0=1; // start timer. while(TF0==0); // run until TF turns to 1 TR0=0; // stop timer TF0=0; // reset the flag } } void main(void) { //char min_MSB,min_LSB; int number = 35; while(1) { convert_min(number); delay_hundred(); number++; if(number >99) number = 0; } }