You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to control the servo motor's angle through bluetooth connection on android app.
It is ok for control the led on and off:
void switchCharacteristicWritten(BLEDevice central, BLECharacteristic characteristic) {
// central wrote new value to characteristic, update LED
Serial.print("Characteristic event, written: ");
if (switchChar.value()) {
Serial.println("LED on");
digitalWrite(ledPin, HIGH);
} else {
Serial.println("LED off");
digitalWrite(ledPin, LOW);
}
}
But when I control the servo motor, the connection was break, the initial position was 90 angles:
void switchCharacteristicWritten(BLEDevice central, BLECharacteristic characteristic) {
// central wrote new value to characteristic, update LED
Serial.print("Characteristic event, written: ");
if (switchChar.value()) {
Serial.println("LED on");
digitalWrite(ledPin, HIGH);
myservo.write(120);
} else {
Serial.println("LED off");
digitalWrite(ledPin, LOW);
myservo.write(60);
}
}
Why the writing for servo motor breaks the BLE connnection?
The text was updated successfully, but these errors were encountered:
DengkeDu
changed the title
Why the connection breaks when I write the servo?
Why the connection breaks when I write the servo motor?
Nov 21, 2017
I want to control the servo motor's angle through bluetooth connection on android app.
It is ok for control the led on and off:
But when I control the servo motor, the connection was break, the initial position was 90 angles:
Why the writing for servo motor breaks the BLE connnection?
The text was updated successfully, but these errors were encountered: