void setup()
{
volatile long *dir;
dir = 0x21; // DDRA
*dir = 0xFF; // segments
dir = 0x30; // DDRF
*dir = 0xFF; // digit control
}
void loop()
{
volatile long *out;
volatile long i;
// -------- Digit 1 : 2 --------
out = 0x31; // PORTB
*out = 0xFF; // all digits OFF
out = 0x22; // PORTA
*out = 109; // 5
out = 0x31;
*out = 2; // digit-1 ON (ACTIVE-LOW)
//for(i=0;i<3000;i++);
// -------- Digit 2 : 5 --------
out = 0x31;
*out = 0xFF; // all digits OFF
out = 0x22;
*out = 91; // 2
out = 0x31;
*out = 1; // digit-2 ON
//for(i=0;i<3000;i++);
}