       }
     } 
     else {
-      if (millis()-blinkRedTimer>300){
-        stateRed=!stateRed;
-        blinkRedTimer=millis();
-        digitalWrite(LED_YELLOW, stateRed);   
+      stateGreen=false;
+      digitalWrite(LED_GREEN, stateGreen);
+      if (millis()-blinkYellowTimer>300){
+        stateYellow=!stateYellow;
+        blinkYellowTimer=millis();
+        digitalWrite(LED_YELLOW, stateYellow);   
       }
       Serial.print("*");
     }


#include <stdio.h>
#include <adk.h>
#define LED_GREEN 53
#define LED_YELLOW 52
#define LED_RED 7
#define BUFFSIZE   255
#define MAX_POWER  400
#define DELAY 50 // Smaller delay breaks everything about communication

char inStringBuffer[BUFFSIZE];
char outStringBuffer[BUFFSIZE];
uint32_t bytesRead = 0;
int blinkGreenTimer, blinkYellowTimer;
bool stateYellow,stateGreen;
bool emergency_mode,warning,FL_edge,FR_edge;
int emergency_sensor_threshold =880,currentState=IDLE;

