   //{
   if (Serial.available()) {
     //Uart.flush();
-    enable = 0;
 	c = Serial.read();
-    if(c == '$' ) enable  =1;
-    if(c == '^') Uart.flush();
+    if(c == '?') {enable = 3; return;}
+
+    if(c == '$' ) {enable  =1; return;}
+    if(c == '#' ) {enable = 2; return; }
+    if(c == '^') {Uart.flush(); return; }
 	Uart.write(c);
 	digitalWrite(led_pin, led_on);
 	led_on_time = millis();

//#include <XBeeS6.h>

//#include "XbeeS6.h"
#define BAUD_RATE 9600

uint8_t my_buffer[20];


}
int j = 0;
int k = 0;
//volatile int enable;
long led_on_time=0;
void loop()
{
  static int enable;
  unsigned char c, dtr;
	static unsigned char prev_dtr = 0;

