Hi,
I am working on the MG996R servo and MG90S with nRF52840.
I am using the following delay logic to operate MG90S. (As per datasheet)For 0 Angle
NRF_LOG_INFO("0 Angle");
nrf_gpio_pin_set(Lock_PIN);
nrf_delay_us(1000);
nrf_gpio_pin_clear(Lock_PIN);
nrf_delay_ms(1000);
For 90 Angle
NRF_LOG_INFO("90 Angle");
nrf_gpio_pin_set(Lock_PIN);
nrf_delay_us(1500);
nrf_gpio_pin_clear(Lock_PIN);
nrf_delay_ms(1000);
For 180 Angle
NRF_LOG_INFO("180 Angle");
nrf_gpio_pin_set(Lock_PIN);
nrf_delay_us(2000);
nrf_gpio_pin_clear(Lock_PIN);
nrf_delay_ms(1000);
MG90S is working perfectly fine. But MG996R create some issues (not moving correctly).
So is there any servo library or .h file so we can use angle logic as available in Arduino.
//////// Available in Arduino for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position }
Thanks in advance.