iiot2k / gpiox

Raspberry Pi gpiox node.js and C++ library
Apache License 2.0
5 stars 2 forks source link

Float Duty Cycles #9

Closed ploewestud closed 4 weeks ago

ploewestud commented 1 month ago

Is it possible, to use Float-Values for the duty cycle? Thank you!

iiot2k commented 4 weeks ago

I think you mean the c++ interface. You can use a c++ type cast. Eg.

float f; (uint32_t) f or static_cast(f)

Since the PWM is generated by software, decimal places after the comma are not useful.