Skip to content

calfeche13/rpi-pico-pwm-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rasberry PI Pico PWM Utils

PWM Utils for the RP2040.

Motivation

This module was developed as part of a personal project for a custom 3D printer bed leveling system. The PWM Utils includes a PWM-to-angle conversion feature, which is necessary because the 3D printer sends a PWM signal to control the servo motor of the auto bed leveling sensor, specifying its current state. The PWM Utils reads the PWM signal from the 3D printer, interprets it, and determines whether the auto bed leveling process has commenced.

Want to Support Me?

If you want me to continue making useful apps like this please support me through the links below :)

Buy Me A Coffee

Buy Me A Coffee

Functions

Sets the PWM configuration.

uint pwm_set_config(uint gpio, uint clkdiv_mode, uint clkdiv);

Measures the value.

int pwm_util_get_measured_value(uint slice_num, int measure_time_ms);

Converts the measured value into frequency.

int pwm_util_measure_frequency(uint gpio);

Converts the measured value into duty cycle.

float pwm_util_measure_duty_cycle(uint gpio);

Converts the measured value into pulse width.

float pwm_util_measure_pulse_width(uint gpio);

Converts the measured value into the angle in degress.

int pwm_util_get_degrees(uint gpio);

About

PWM Utils for the Raspberry pi Pico

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published