Hoe geef ik decimale punt op de resulterende temperatuur?

V

vanvan00

Guest
Hoe geef ik decimale punt op de resulterende temperatuur met mijn Lm35 temperatuur circuit?Im using PIC18F452 microcontroller mijn code is dan thanks a lot

unsigned temp_value;
char out [6];

void main () (
ADCON1 = 0x80;
TRISA = 0xFF; / / PORTA als input
TRISB = 0x00; / / PORTB als uitgang
Lcd_Init (& PORTB);
Lcd_Cmd (LCD_CLEAR);
Lcd_Cmd (LCD_CURSOR_OFF);
Lcd_Out (1,1, "Temperatuur is:");do (
temp_value = (Adc_Read (0) / 2); / / Lezen analoge ingang
WordToStr (temp_value, out);
Lcd_Out (2,10, out);
Lcd_Chr_Cp (223);
Lcd_Chr_Cp ( 'C');
delay_ms (2500); / / Proef op 2,5 sec
) While (1);
)

 

Welcome to EDABoard.com

Sponsor

Back
Top