Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setPWMFreq for ATTiny variants #99

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

caternuson
Copy link
Contributor

For #98.

Fixes logic in setPWMFreq() to support the ATTiny variants, similar to same logic found in analogWrite().

Tested with following example sketch running on a QT PY M0 attached to an ATTiny1616 dev breakout (PID 5690) and scoping pin 1:

#include <Adafruit_seesaw.h>

Adafruit_seesaw ss;

void setup() {
  Serial.begin(115200);
  while (!Serial);
  
  Serial.println("Seesaw PWM Test.");

  if (!ss.begin()) {
    Serial.println("Failed to init seesaw.");
    while(1);
  }
  Serial.println("Seesaw initd.");
}

void loop() {
  ss.setPWMFreq(1, 100);
  delay(2000);
  ss.setPWMFreq(1, 300);
  delay(2000);
}

BEFORE
no output
before

AFTER
expected output
after1
after2

@caternuson
Copy link
Contributor Author

@ladyada for review

@caternuson caternuson merged commit b2932ab into adafruit:master Mar 26, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants