PaulStoffregen / PWMServo

Control RC Servo motors with interrupt-resilient PWM
http://www.pjrc.com/teensy/td_libs_Servo.html
26 stars 18 forks source link

Teensy 3.6 pin 17 not working #2

Closed MangaValk closed 4 years ago

MangaValk commented 5 years ago

Description

Describe your problem. On the teensy 3.6 pin 16 and 17 will not attach, digitalPinHasPWM returns false. According to the manual pin 16 and 17 should work.

Steps To Reproduce Problem

Please give detailed instructions needed for anyone to attempt to reproduce the problem. Attach a servo to pin 16 or 17 and print the result of attach.

Hardware & Software

Board Teensy 3.6 Shields / modules used none Arduino IDE version 1.8.9 Teensyduino version (if using Teensy) Version info & package name (from Tools > Boards > Board Manager) Operating system & version Any other software or hardware?

Arduino Sketch

// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
#include "PWMServo.h"

PWMServo servostest;

void setup() {
Serial.begin(115200);
Serial.println(servostest.attach(17));
}

void loop() {
servostest.write(90);
}

Errors or Incorrect Output

If you see any errors or incorrect output, please show it here. Please use copy & paste to give an exact copy of the message. Details matter, so please show (not merely describe) the actual message or error exactly as it appears.

MangaValk commented 5 years ago

I was searching through the Teensy source code myself to possibly write a fix for everyone. I found out that the digitalPinHasPWM for the teensy 3.6 board isn't correct compared to the documentation. https://github.com/PaulStoffregen/cores/blob/fc79132670ac83ce7cae8e2bac64be109fbfe35e/teensy3/pins_arduino.h#L179

PaulStoffregen commented 5 years ago

Fixed https://github.com/PaulStoffregen/cores/commit/63aba265dbd7df55d366da4ed6af2c0a62df3f32

MangaValk commented 5 years ago

Many thanks! Can't try it now since I'm away from home. Love your teensy 3.6 board!

Akhaides commented 4 years ago

corelib 1 @buildprop "lesson 16"

PaulStoffregen commented 4 years ago

Verified this is working. Closing this old issue.

file