void setup() {
// put your setup code here, to run once:
volatile char *dirf = 0x30;
*dirf = 0x03;
volatile char *dirk = 0x107;
*dirf = 0x03;
volatile char *outk = 0x108;
volatile char *outf = 0x31;
while(1){
volatile int i = 9;
//PULL UP
*outf = 0x01; // If A0 is 1, LED is ON, as we know that potential drop from high to low,
// Here, as we are mentioning "1", it will be 5V --> 5V. So, the current
// prefer to use least resistance path and because of this LED turns ON
delay(1000);
while(i){
*outf = 0x02;
delay(1000);
*outf = 0x01;
delay(1000);
i--;
}
*outf = 0x00;
delay(10);
// PULL DOWN
*outk = 0x01;
delay(1000);
i = 9;
while(i){
*outk = 0x02;
delay(1000);
*outk = 0x01;
delay(1000);
i--;
}
*outk = 0x00;
delay(10);
}
}
void loop() {
// put your main code here, to run repeatedly:
}