HI Tofinkh,
The program that i had written is below:
I have also uploaded the file, please do have a look and please do let me know if you find any mistake, thanks a lot, i do greatly appreciate your help
#include<AT89x051.h>
char a[10]={0x07,0x17,0x27,0x37,0x47,0x57,0x67,0x77,0x87,0x97};
char b[10]={0x0F,0x1F,0x2F,0x3F,0x4F,0x5F,0x6F,0x7F,0x8F,0x9F};
void delay(int count);
void main(void)
{
unsigned char adc_data;
P1=0x03; // setting P1.0 and P1.1 as inputs and the rest of the P1 as output
while(1){
P1_1=adc_data; // read the data (from the voltage input) from P1.1 and store it in adc_data
delay(5);
P1=P1&0x03; // set P1 again such that P1.0 and P1.1 are inputs and the other P1 ports sre output
P1=a[adc_data%10]; // find the remainder of the data obtained e.g if it is 0x15, the remainder is 1 thus P1& 0x03=1
// and a[1]=1 and thus 1 would be displayed
delay(5);
}
}
void delay (int count)
{
int j;
for(j=0;j< count;j++){
continue;
}
}