Skip to content

Commit 14214ac

Browse files
Ernesto E. Lopez Cfacchinm
authored andcommitted
Upgrade servo performance
1 parent b91e3aa commit 14214ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

extras/D11-Firmware/D11-Firmware.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void setup() {
5252
Wire.onReceive(receiveEvent);
5353
pinMode(LED_BUILTIN, OUTPUT);
5454
pinMode(IRQ_PIN, OUTPUT);
55-
analogWriteResolution(8);
55+
analogWriteResolution(24);
5656
}
5757

5858
volatile uint8_t command = 0;

src/ServoMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mc::ServoMotor::ServoMotor() {
2525
};
2626

2727
void mc::ServoMotor::setAngle(int angle) {
28-
setData(SET_PWM_DUTY_CYCLE_SERVO, instance, map(angle,0,180,7,28));
28+
setData(SET_PWM_DUTY_CYCLE_SERVO, instance, map(angle,0,180,600000,1740000));
2929
}
3030

3131
void mc::ServoMotor::detach() {

0 commit comments

Comments
 (0)