My oversight, assumed it was PWM Output that you needed the tenths accuracy.
Is your problem with Pulsin or with the subsequent math?
If it's with the math, then you simply need to scale it up by a factor of ten, so that your division doesn't give you 37.2 (which because of integer math will truncate to 37), but result in 372. Therefore instead of 0-100, internally in your code you will work 0-1000 knowing that the least significant digit is TENTH's, and when outputting you can then place your decimal point appropriately.




Bookmarks