diff options
Diffstat (limited to 'src/pwm.cpp')
| -rw-r--r-- | src/pwm.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pwm.cpp b/src/pwm.cpp index 3a78d23..267765b 100644 --- a/src/pwm.cpp +++ b/src/pwm.cpp @@ -2,9 +2,9 @@ void PWM::init() { // Tell GPIO 0 they are allocated to the PWM - gpio_set_function(SERVO_PIN, GPIO_FUNC_PWM); + gpio_set_function(MICRO_DEFAULT_PWM, GPIO_FUNC_PWM); // Find out which PWM slice is connected to GPIO 0 (it's slice 0) - uint slice_num = pwm_gpio_to_slice_num(SERVO_PIN); + uint slice_num = pwm_gpio_to_slice_num(MICRO_DEFAULT_PWM); // Configure PWM slice and set it running pwm_config cfg = pwm_get_default_config(); @@ -24,7 +24,7 @@ void PWM::set_duty_cycle(int duty_cycle_percent) { uint32_t raw_value = WRAP_VALUE * (duty_cycle_percent / 100.0); // Set the duty cycle - pwm_set_gpio_level(SERVO_PIN, raw_value); + pwm_set_gpio_level(MICRO_DEFAULT_PWM, raw_value); } void PWM::set_servo_percent(int percent) { |
