#include "hardware_dependent.h"
void setup() {
// put your setup code here, to run once:
init_port();
}
void loop() {
// put your main code here, to run repeatedly:
volatile long x;
volatile char i;
volatile long k;
x=523459;
while(x!=0)
{
i=x;
x=x/10;
}
if(i==0)
{
x=0b00111111;//to display zero without decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==1)
{
x=0b00000110;//to display one without decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==2)
{
x=0b01011011;//to display two without decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==3)
{
x=0b11001111;//to display three with decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==4)
{
x=0b01100110;//to display four without decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==5)
{
x=0b11101101;//to display five with decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==6)
{
x=0b01111101;//to display six without decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==7)
{
x=0b10000111;//to display seven with decimal point
output(x);
for(k=0;k<800000;k++);
}
else if(i==8)
{
x=0b01111111;//to display eight without decimal point
output(x);
for(k=0;k<800000;k++);
}
else
{
x=0b11101111;//to display nine with decimal point
output(x);
for(k=0;k<800000;k++);
}
}