#include "head.h";
void setup()
{
//Setup the address for direction:
init_program();
}
void loop()
{
volatile long i;
char count=0;
char arr[4] = {0x00,0x01,0x02,0x04};
//Loop for controlling three LED's:
while(1){
//Condition to check INPUT:
if((input() & 0x01) == 0x01){
count++;
for(i=0; i<100000; i++);
}
//OUPUT with delay:
out(arr[count]);
for(i=0; i<10000; i++);
//Condition to start from index 0:
if(count==3){
if((input() & 0x01) == 0x01){
count=0;
}
}
}
//out(7);
}