   readLamp(ptr);
   
 }
-void readTemp(char* ptr){
+void readTemp(byte* ptr){
   ptr[12] = 0xFF;
   ptr[13] = 0x02;
 }
-void readHum(char* ptr){
+void readHum(byte* ptr){
   ptr[12] = 0xFF;
   ptr[14] = 0x03;
 }
-void readLum(char* ptr){
+void readLum(byte* ptr){
   ptr[12] = 0xFF;
-  ptr[15] = 0xFF;
+  ptr[15] = 0x05;
 
 }
 
-void readSwitch(char* ptr){
+void readLamp(byte* ptr){
   ptr[12] = 0xFF;
-  ptr[15] = switchStatus;
+  ptr[16] = lampStatus;
+
+}
+void readSwitch(byte* ptr){
+  ptr[12] = 0xFF;
+  ptr[17] = switchStatus;
 
 }
 
-void readLamp(char* ptr){
-  ptr[12] = 0xFF;
-  ptr[15] = lampStatus;
 
-}
 
-void switchLight(char* ptr)
+void switchLight(byte* ptr)
 {
   lampStatus = ptr[16];
   if(lampStatus == 0xFF){

const uint64_t pipes[2] = { 0xF0F0F0F001LL, 0xF0F0F0F002LL };
const byte shortAddr = 0x02;
int led = 13;
char switchStatus = 0;
char lampStatus = 0;
void setup(void)
{
  Serial.begin(57600);

    }

}
void runCommand(byte *ptr)
{
  //Serial.println(ptr[10]);
  switch (ptr[10])
  {
    case 0:
    {
      readAllSensors(ptr);  
      break;
    }
    case 1:
    {
      if (ptr[12]== 0x00){
