Skip to content

pwm improvements #304

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

Closed
wants to merge 1 commit into from
Closed

pwm improvements #304

wants to merge 1 commit into from

Conversation

bigdinotech
Copy link
Contributor

-add capability to change pwm signal frequency with analogWriteFrequency
-improve pwm signal frequency accuracy

-add capability to change pwm signal frequency with analogWriteFrequency
-improve pwm signal frequency accuracy
@bigdinotech
Copy link
Contributor Author

@eriknyquist @SidLeung ready for review

@@ -47,7 +49,7 @@ extern void analogReference( eAnalogReference ulMode ) ;
* \param pin
* \param val
*/
extern void analogWrite( uint8_t pin, int val ) ;
extern void analogWrite( uint8_t pin, uint32_t val ) ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required (changing the API)? Assuming we're still just looking for a positive integer, can you leave the analogWrite declaration as it was, and instead cast to uint32_t as needed?

*
* \param res
*/
extern void analogWriteFrequency(uint8_t pin, uint32_t freq);
Copy link
Contributor

@eriknyquist eriknyquist Sep 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would recommend using int for both pin and freq, if possible-- just more Arduino-y :)

@eriknyquist
Copy link
Contributor

+1

@eriknyquist
Copy link
Contributor

@bigdinotech ready for merging?

@bigdinotech
Copy link
Contributor Author

@eriknyquist still needs to be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants