Skip to content

using pwmWrite.h for controlling led and servo  #42

@oogre

Description

@oogre

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions