Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - 5 1 MCU uses DS 18B20 as the thermostat, and wants to display the temperature with the last three digits of the digital tube, including ten digits, single digits and decimal digits.
5 1 MCU uses DS 18B20 as the thermostat, and wants to display the temperature with the last three digits of the digital tube, including ten digits, single digits and decimal digits.
Void dis_temp(uint t)// Display the temperature value function t to transfer the shaped temperature value.

{

Uint stone, kudzu, stone powder;

Stone = t/100;

ge = t % 100/ 10;

shifen = t % 100% 10;

P 1 = table [stone];

led 1 = 0; //bit selection, the first digital tube is on.

Delay (5); //delay, light for a while

led 1 = 1; //Close

P 1 = table [ge];

led 2 = 0; //bit selection, the second digital tube is on.

Delay (5);

led 2 = 1;

p 1 = table[shifen];

led 3 = 0; //bit selection, the third digital tube is on.

Delay (5);

led 3 = 1;

led 4 = 1;

}