Grades Centigrade to Farenheit
Moderator: Benj
-
electron67
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
Grades Centigrade to Farenheit
Hello to everyone, something is wrong; I am use the LM61 (-30 TO 100 GRADE CENTIGRADE)
600mV offset, 10 mV/ºC, +300 mV to 1600 mV; -30ºC to +100ºC.
I want conver to ºF , but is wrong, EJEM. 30ºC is: ºC(9) / 5 + 32 = ºF = 86ºF
I use 4 display 7 seg. The data give to me is 150ºF
Someone can help me ?
600mV offset, 10 mV/ºC, +300 mV to 1600 mV; -30ºC to +100ºC.
I want conver to ºF , but is wrong, EJEM. 30ºC is: ºC(9) / 5 + 32 = ºF = 86ºF
I use 4 display 7 seg. The data give to me is 150ºF
Someone can help me ?
- Attachments
-
- GradosC_Fv1.34f887.fcf
- FLOWCODE FILE
- (15.68 KiB) Downloaded 291 times
- JohnCrow
- Valued Contributor

- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
Re: Grades Centigrade to Farenheit
Hi
The formula you have is correct
F = C * (9/5) +32
At work so not able to look at flowcode
but the markets might make a difference
The formula you have is correct
F = C * (9/5) +32
At work so not able to look at flowcode
but the markets might make a difference
1 in 10 people understand binary, the other one doesn't !
-
electron67
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
Re: Grades Centigrade to Farenheit
The data in ºC is correct, but in ºF not, maybe I have wrong the file ?
I think that can use the LM35 too
I think that can use the LM35 too
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Grades Centigrade to Farenheit
Hi electron67,
I was going to look a to your flowchart tonight after work, and sort it out for you so it correctly shows fahrenheit.
http://www.matrixmultimedia.com/mmforum ... 445#p49124
( in fact it's worth looking at the whole thread as its interesting reading!)
The sensor increases or decreases 1 byte per degC
When I convert from C to F, I just use F = C * 1.8 + 32
I know the 1.8 is just same as 9/5 (standard people use).
But I thought why use a calculation when a simple constant will do?
Martin
I was going to look a to your flowchart tonight after work, and sort it out for you so it correctly shows fahrenheit.
For creating a very simple flowchart to read temperature, take a look at this:electron67 wrote: I think that can use the LM35 too
http://www.matrixmultimedia.com/mmforum ... 445#p49124
( in fact it's worth looking at the whole thread as its interesting reading!)
The sensor increases or decreases 1 byte per degC
When I convert from C to F, I just use F = C * 1.8 + 32
I know the 1.8 is just same as 9/5 (standard people use).
But I thought why use a calculation when a simple constant will do?
Martin
Martin
- Mantas
- Posts: 221
- Joined: Tue May 15, 2012 10:32 pm
- Location: Klaipeda, Lithuania - North sea, UK
- Has thanked: 57 times
- Been thanked: 27 times
Re: Grades Centigrade to Farenheit
Hi,
try changing it to:
Best regards,
Mantas
try changing it to:
Code: Select all
ADC_Value1 = ADC_Value1 * 9.0
ADC_Value1 = ADC_Value1 / 5.0
ADC_Value1 = ADC_Value1 + 32.0Mantas
Science is my true religion.
-
electron67
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
Re: Grades Centigrade to Farenheit
Hi Mantas
I change 9.0, 5.0 and 32.0; but to 27ºC display indicate 144ºF
Hi Martin
Maybe not is the same display the temperature in the LCD and 7 seg display 4 digit, the program change ? Is correct my file flowcode ?
Thanks
I change 9.0, 5.0 and 32.0; but to 27ºC display indicate 144ºF
Hi Martin
Maybe not is the same display the temperature in the LCD and 7 seg display 4 digit, the program change ? Is correct my file flowcode ?
Thanks
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Grades Centigrade to Farenheit
Hi electron67
The problem with your Flowchart is MOD can't be used with floats.
So I have added Float to int conversion and reduced and simplified your calculations.
Note: All your calculations are correct
With your Flowchart:
If you ReadAsVoltage (using Float). e.g ADC_Value = float2int (ADC_Value1)
do all calculations using floats as you already have done.
Then convert Float to Int.
Change all your Digits e.g from DIGIT4 = ADC_Value1 / 1000 to
DIGIT4 = ADC_Value/ 1000
Then your flowchart should work on hardware.
I have done that with GradosC_Fv1.34f887 with Float to Int.fcf
Martin
The problem with your Flowchart is MOD can't be used with floats.
So I have added Float to int conversion and reduced and simplified your calculations.
Note: All your calculations are correct
With your Flowchart:
If you ReadAsVoltage (using Float). e.g ADC_Value = float2int (ADC_Value1)
do all calculations using floats as you already have done.
Then convert Float to Int.
Change all your Digits e.g from DIGIT4 = ADC_Value1 / 1000 to
DIGIT4 = ADC_Value/ 1000
Then your flowchart should work on hardware.
I have done that with GradosC_Fv1.34f887 with Float to Int.fcf
Martin
- Attachments
-
- GradosC_Fv1.34f887 with Float to Int.fcf
- (15.77 KiB) Downloaded 306 times
-
- GradosC_Fv1.34f887 v2.fcf
- (15.39 KiB) Downloaded 275 times
Martin
-
electron67
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
Re: Grades Centigrade to Farenheit
Hi Martin, thank you one more time .....
Now reading the temperature in ºF correctly.
Electron67
Now reading the temperature in ºF correctly.
Electron67
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Grades Centigrade to Farenheit
Your welcome.
Glad its working for you.
Thanks for updating us.
I have just added some extra text you may not have seen as you was online while I was editing my post.
Glad its working for you.
Thanks for updating us.
I have just added some extra text you may not have seen as you was online while I was editing my post.
Martin
-
electron67
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Grades Centigrade to Farenheit
No problem.
So long as information has helped you.
Did the help button on the component macro help you more to learn about the functions available?
So long as information has helped you.
Did the help button on the component macro help you more to learn about the functions available?
Martin
-
electron67
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
Re: Grades Centigrade to Farenheit
The button help is good but not is clear when the function should be used (when using an example in flowchart of the function is more understandable). I think that an example together with button help in functions complex (not all) is ideal.
But the help that you give in the forum is essential for learning.... Thank you.
Electron67
But the help that you give in the forum is essential for learning.... Thank you.
Electron67