ok I cannot for some reason get it in my head what is wrong. My brain just can’t comprehend this problem 2 days into this from reading on the net trying just about everything I can try…
the code, overflow, bits limit, limitations of float ect…???
One of you smart guys know what the problem is and explain how the hardware or code is handing it?
my best guess is it’s overflowing throwing a 0 but I thought float could do 32bit math or is it my code??
I need to get percentage from 1 to 65535 / 65535 * 100 so I can get a percentage of a duty cycle…
I have tried floats and longs because I would need to see 0.392156863 or at least to 0.001 to 100% for a duty cycle. This is the last thing I tried before reaching out here.
float dcperc = ((5637/65535l)*(100)); lcd.print (dcperc);
The other thing I would need is a value in voltage.
float vout = ((5)*(step)/(65535)); lcd.print (vout)
I don’t have problems with anything else until I hit this 65535 then for some reason it just doesn’t work except give me a 0.