Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

setPulseWidth - removed wrong map #2

Closed
wants to merge 1 commit into from

Conversation

RadekVoltr
Copy link

There is wrong map in setPulseWidth which map native pulse width into angle and make it whole function useless

There is wrong map in setPulseWidth which move native pulse width into angle
@khoih-prog
Copy link
Owner

I think the correct fix will be

//servo[servoIndex].position  = map(pulseWidth, _minUs, _maxUs, 0, 180);

writeMicroseconds(servoIndex, pulseWidth);

instead of

//servo[servoIndex].position  = map(pulseWidth, _minUs, _maxUs, 0, 180);

writeMicroseconds(servoIndex, servo[servoIndex].position);

Can you check and verify ?

khoih-prog added a commit that referenced this pull request Feb 28, 2022
### Releases v1.1.0

1. Convert to `h-only` style
2. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
3. Fix setPulseWidth() bug. Check [setPulseWidth - removed wrong map #2](#2)
4. Optimize code by using passing by `reference` instead of by `value`
khoih-prog added a commit that referenced this pull request Feb 28, 2022
### Releases v1.1.0

1. Convert to `h-only` style
2. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
3. Fix `setPulseWidth()` bug. Check [setPulseWidth - removed wrong map #2](#2)
4. Optimize code by using passing by `reference` instead of by `value`
khoih-prog added a commit that referenced this pull request Feb 28, 2022
### Releases v1.1.0

1. Convert to `h-only` style
2. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
3. Fix `setPulseWidth()` bug. Check [setPulseWidth - removed wrong map #2](#2)
4. Optimize code by using passing by `reference` instead of by `value`
@khoih-prog
Copy link
Owner

Hi @RadekVoltr

The new RP2040_ISR_Servo releases v1.1.0 has just been published. Your contribution is noted in Contributions and Thanks

I'm looking forward to receiving more of your contributions (bug report, enhancement, PR, etc.)

Best Regards,


Releases v1.1.0

  1. Convert to h-only style
  2. Add example multiFileProject to demo for multiple-file project
  3. Fix setPulseWidth() bug. Check setPulseWidth - removed wrong map #2
  4. Optimize code by using passing by reference instead of by value

@khoih-prog khoih-prog closed this Feb 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants