 // the second is a subcommand
 void Execute()
 {
-  bytes = 0; // empty input buffer (only one command at a time)
   cmd = buf[0];
   if (cmd == 0 || cmd == 32) return;
   


//=======================================

// 'power off' command
void power()
{
  pulsePin(POWER_PIN, 20);
}

//=======================================





// power sensing





//=======================================

// 'battery voltage' command
// result in mV and mA
void battery()
{
  float shuntvoltage = ina219.getShuntVoltage_mV();
  float busvoltage = ina219.getBusVoltage_V();
  int current_mA;
  current_mA = int(ina219.getCurrent_mA());
  int voltage;
  voltage = (int)(busvoltage * 1000 + shuntvoltage);
  Serial.write('b');
  Serial.println(voltage);
  Serial.write('a');
  Serial.println(current_mA);
}

// INA219 control commands

{
  byte i = 0;
  byte fin = index + count;
  if (fin > COMMAND_BUFFER_SIZE) fin = COMMAND_BUFFER_SIZE;
  while (buf[index] >= '0' && buf[index] <= '9' && index < fin)
  {
    i *= 10;
