arduino / arduino/ArduinoCore-arc32
Why the connection breaks when I write the servo motor?
- Dominant language
- C
- Stars
- 330
- Forks
- 281
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue from the switchCharacteristicWritten callback, comparing the LED-only and servo versions on the Arduino board with the Android app. Inspect the surrounding servo initialization and BLE setup, then verify the connection remains stable while changing between the two servo angles and document the observed cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, arduino, c
- Domain
- embedded-iot, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100