Controling servo speed by slider

Does the "thumbposition number that is received from Bluetooth device" come in as digits of a number?

If so, maybe you need to parse serial into a number per something like one of these:

or

The critical tricks are collecting the digits into a number, and doing something with the number once you recognize you aren't getting digits any more. Some snippets:

    case '0' ... '9': // digits -- collect a series of them
      numberMode = true;
      currentValue *= 10;
      currentValue += c - '0';
      break;
  if ( ! ((c >= '0') && (c <= '9')) ) {
    completeNumber();
  }
void completeNumber() {
  if (numberMode) {
    Serial.print(currentValue);
    numberMode = false;
  }
}

But it really depends on how all the Bluetooth slider stuff sends the number.

1 Like