Apologies for my previous not-so-good advice.
It turns out that the files I got from the “fixed” branch don’t really meet requirements.
It gave PWM OK, but the period was something like34.8 ms, not 20 ms that we usually expect for analog servos.
Worse than that: The pulse width varied from about 15.5 ms to about 17.3 ms. Certainly wouldn’t work, since the servos will work with pulse widths on the order of one or two milliseconds.
Real bottom line: Tested
Follow the steps I enumerated in my previous post, but:
Get Servo.cpp and ServoTimers.h from the site recommended by Citric and copy those to your libraries\Servo\src\samd directory. I zipped them and attached them in this post. (I deleted the unfortunate zip file from my previous post.)
With these files, I changed the Sweep example to use pin D0 and got the following:
Period is 20 ms
Pulse width varies from about 0.5 ms (500 us) to about 2.44 ms (2400 us).
My servo is rated to operate at 5 Volts, but it actually moved from stop to stop with the 3.3V from the Wio Terminal.
Again, I apologize for my previous bad advice. (I did say that I hadn’t tested very much, but I just got so excited at having it compile OK and observing a square wave on D0, that I didn’t notice its improper timing.) Sorry. I shouldn’t have posted until I did some relevant testing.
Anyhow, the files from PaintYourDragon seem to work.
Regards,
Dave
Servox.zip (5.0 KB)