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

using pwmWrite.h for controlling led and servo #42

Open
oogre opened this issue Jan 11, 2024 · 0 comments
Open

using pwmWrite.h for controlling led and servo #42

oogre opened this issue Jan 11, 2024 · 0 comments

Comments

@oogre
Copy link

oogre commented Jan 11, 2024

Hello,

I'm a bit confuse,
about this function

void Pwm::wr_ch_pair(int ch, uint32_t frequency, uint8_t bits) {
  mem[ch].frequency = frequency;
  mem[ch].resolution = bits;
  if (ch % 2 == 0) { // even ch
    mem[ch + 1].frequency = frequency;
    mem[ch + 1].resolution = bits;
  } else { // odd ch
    mem[ch - 1].frequency = frequency;
    mem[ch - 1].resolution = bits;
  }
}

I cannot see the purpose of using 2 mem channels to store info about only one servo motor,
and why don't you mark this channel +1 or -1 as used ?
It's blocking me to use properly servo and pwm at the same time

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

No branches or pull requests

1 participant