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 2 days ago

ploewestud commented 6 days ago

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

iiot2k commented 2 days 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.