 //        Serial.println(loadcell_data);
 
 //
-        Serial.print("Encoder: ");
-        Serial.println(encoder_data);
         break;
       }
-      return(encoder_data);
+      // return(encoder_data);
   }
 }
 

}

//******************************
// CURRENT DATA READ
//******************************
float currentDataRead()
{
  current_data = 0;
  unsigned char len = 0;
  unsigned char buf[8];

  // clear the string:
  sync();

  if (CAN_MSGAVAIL == CAN.checkReceive())           // check if data coming
  {
    CAN.readMsgBuf(&len, buf);    // read data,  len: data length, buf: data buf

    unsigned int canId = CAN.getCanId();
    
    Serial.print("Current: ");
    
      for(int i = 0; i<len; i++)    // print the data
        {
            Serial.print(buf[i], HEX);
            Serial.print("\t");
        }
    Serial.println();

    current_data = buf[2];
    current_data <<= 8;
    current_data = current_data | buf[3];
    // current_data <<= 8;
    // current_data = current_data | buf[6];
    // current_data <<= 8;
    // current_data = current_data | buf[7];

    // Serial.println(current_data);

    return(current_data);
  }
}

//****************

        // }
        // Serial.println();
        break;

      // ID 321 message has information sent by the amplification board
      case 0x321:
        encoderDataRead();

        // // load cell information is read from buf[1], buf[2] and buf[3] and converted to decimal
        loadcell_data = buf[1];
