Skip to content

A question about pwm pwmSetRange/pwmWrite #1

@yxdming

Description

@yxdming

Now i am developing a tool in my pi 3b+, that play a 16-bit WAV file with PWM, reference to the wiki https://github.com/RichardChambers/raspberrypi/wiki/Notes-on:-Pulse-Width-Modulation-(PWM)---Discussion, i read the data from the WAV file, and write it to 32 pins with api pwmWrite.

I have been confused for few days, that the parameter of range in pwmSetRange is 0-4096, but my wav file is 16-bit, and it's range is -32768~32767, can i write it directly with pwmWrite.
Do i need to convert the 16-bit value to 8-bit value.

Looking forword to receive your answers.

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