Implement the following integer methods:
a) Method celsius returns the Celsius equivalent of a Fahrenheit calculation
celsius = 5.0 / 9.0 * ( fahrenheit - 32 )
b) Method fahrenheit returns the Fahrenheit equivalent of a Celsius the calculation
fahrenheit = 9.0 / 5.0 * celsius + 32
c) Use the methods from parts (a) and (b) to write an application either to enter a Fahrenheit TemperATure and display the Celsius or to enter a Celsius TemperATure and display the Fahrenheit equivalent.
//通過18B20檢測的數(shù)字溫度可在電腦上顯示當前溫度值
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit DS=P2^2 //define interface
uint temp // variable of TemperATure
uchar flag1 // sign of the result positive or negative
sbit dula=P2^6
sbit wela=P2^7
Thermostat Project using DS18B20 and P89V51RD2 Microcontroller. Compiler used is SDCC. Schematic Included. Main file is "09.C". The code is written for turning the relay on and off at particular TemperATure thresholds.
The LM35 of National Semiconductors that is used in this project is a precision centigrade TemperATure sensor, which has an analog output voltage. It has a range of -55潞C to +150潞C and a accuracy of 鹵0.5潞C . The output voltage is 10mV/潞C . The output voltage is converted by the AD convertor of the AT Mega8. The TemperATure is displayed on an LCD module. In this example the thermometer has a range of 0潞C to 40潞C and a resolution of 0.5潞C. If you want to have a readout in Fahrenheit you can use the LM34.
This software allows users to see how a serial async com port can be used to comunicate with a sync device (SPI). In this case, the software reads a low cost digital TemperATure sensor IC.
The 2D CFD Program NaSt2D
The program is a 2D solver for the incompressible, transient Navier-Stokes equations including the TemperATure equation and free boundary problems. It uses finite differences for discretization on a structured equidistant staggered grid, central and upwind (donor-cell) discretization of the convective parts and an explicit time stepping scheme. The free boundary value problems are treated with the MAC technique.