int seg []={0xfe,0x38,0xdd,0x7d,0x3b,0x77,0xf7,0x3c,0xff,0x7f};
int up = 9;
int dw = 10;
int count = 0;
void setup() {
// put your setup code here, to run once:
for (int i=0;i<=7;i++)
pinMode(i, OUTPUT);
pinMode(up, INPUT_PULLUP);
pinMode(dw, INPUT_PULLUP);
//DDRD = 0xff;
}
void loop() {
// cleck:
/*for (int j=0; j<=9; j++)
{
PORTD = seg[j];
delay(1000);
}
*/
if(digitalRead(up) == 0 && count <= 8)
count ++;
if(digitalRead(dw) == 0 && count >= 1)
count --;
PORTD = seg[count];
delay(250);
}