#include
enum States {Start, Init, LED_Lit1} state;
unsigned char button;
#define button PINA & 0x01
void tick_LED()
{
switch(state) { // Transitions
case Start: // Starttransition
state = Init;
break;
case Init: // Initialtransition
if(button == 1){ // If PINA0 is 1 state goes to led_lit inLED_Lit1
state = LED_Lit1;
}
else{ // If PINA0 is 0 state remains in initial
state = Init;
}
break;
case LED_Lit1: // LED_Lit1 Transition
if(button == 0){ // If PA0 is 1 state remains in LED_Lit1
state = LED_Lit1;
}
else {
state = Init; // if PA1 is 1 state goes toinitial
}
break;
default:
state = Start;
break;
}
switch(state) { // Actions
case Start:
PORTB = 0x01; // PB0 set to 1
break;
case Init:
PORTB = 0x01; // PB0 set to 1
break;
case LED_Lit1:
PORTB =
PayPal Gateway not configured
PayPal Gateway not configured