AtomSoft
Well-Known Member
Ok while this is simple...
What if the centigrade value is supposed to be NEGATIVE?
So if my "centigradeT" is 5 and my NEG variable is 1
Then i show -5 on LCD
This works well... but how would i show this in fahrenheit? which is 23F
How would i code this?
NOTE:
The data is 14bits long (13 really) but NEG is 14th bit
Im using DOUBLES for my conversions... is that ok?
The PIC is a PIC18F27J53
Im using C18
Code:
fahrenheitT = centigradeT;
fahrenheitT *= 9.0;
fahrenheitT /= 5.0;
fahrenheitT += 32;
What if the centigrade value is supposed to be NEGATIVE?
So if my "centigradeT" is 5 and my NEG variable is 1
Then i show -5 on LCD
This works well... but how would i show this in fahrenheit? which is 23F
How would i code this?
NOTE:
The data is 14bits long (13 really) but NEG is 14th bit
Im using DOUBLES for my conversions... is that ok?
The PIC is a PIC18F27J53
Im using C18
Last edited: