void setup() {
// put your setup code here, to run once:
volatile char *dirf, *dirk, *dataf, *ink, x;
volatile long i;
// port setup
//******************************************
// Press 0th switch glow 8 LEDs
dirf = 0x30; dirk = 0x107;
*dirf = 0xFF; *dirk = 0x00;
// data
dataf = 0x31; ink = 0x106;
while (1) {
x = *ink;
if ((x & 0x02) == 0x02) {
*dataf = 0x99;
}
}
}
void loop() {
// put your main code here, to run repeatedly:
} // Press 1st switch At a time glow 0th LED,3rd LED, 1001 1001
// 4th LED,7th LED