All pins reserved by servo. I cant use a DC motor at the same time.
Hi everyone, I have just started to use MATLAB with arduino for a university project.
I’m trying to use both a servo and a DC motor with an arduino, but when I initialise the servo motor, all the pins (or at least the PWM ones) become reserved to the servo.
a = arduino(‘COM4’, ‘Uno’, ‘Libraries’, ‘Servo’)
s = servo(a, ‘D11’, ‘MinPulseDuration’, 0.00055, ‘MaxPulseDuration’, 0.0024)
writePWMDutyCycle(a, "D9", 1)
The error I get is:
"Digital pin D9 is reserved by Servo in ‘Reserved’ mode. To change the pin configuration, clear all variables holding onto this resource."
I have tried other pins, but they are all reserved. If i don’t initialise the servo, it works.
How can I reserve just one pin for the servo and not all of them?
ThanksHi everyone, I have just started to use MATLAB with arduino for a university project.
I’m trying to use both a servo and a DC motor with an arduino, but when I initialise the servo motor, all the pins (or at least the PWM ones) become reserved to the servo.
a = arduino(‘COM4’, ‘Uno’, ‘Libraries’, ‘Servo’)
s = servo(a, ‘D11’, ‘MinPulseDuration’, 0.00055, ‘MaxPulseDuration’, 0.0024)
writePWMDutyCycle(a, "D9", 1)
The error I get is:
"Digital pin D9 is reserved by Servo in ‘Reserved’ mode. To change the pin configuration, clear all variables holding onto this resource."
I have tried other pins, but they are all reserved. If i don’t initialise the servo, it works.
How can I reserve just one pin for the servo and not all of them?
Thanks Hi everyone, I have just started to use MATLAB with arduino for a university project.
I’m trying to use both a servo and a DC motor with an arduino, but when I initialise the servo motor, all the pins (or at least the PWM ones) become reserved to the servo.
a = arduino(‘COM4’, ‘Uno’, ‘Libraries’, ‘Servo’)
s = servo(a, ‘D11’, ‘MinPulseDuration’, 0.00055, ‘MaxPulseDuration’, 0.0024)
writePWMDutyCycle(a, "D9", 1)
The error I get is:
"Digital pin D9 is reserved by Servo in ‘Reserved’ mode. To change the pin configuration, clear all variables holding onto this resource."
I have tried other pins, but they are all reserved. If i don’t initialise the servo, it works.
How can I reserve just one pin for the servo and not all of them?
Thanks arduino, servomotor, dc, dc motor, servo, servo motor, pwm pins, power_electronics_control, electric_motor_control, power_conversion_control MATLAB Answers — New Questions