Bonjour je suis un jeune étudiant et lors de nos études et réalisation nous avons décidé de réaliser un thermomètre électronique commandé via un pic 16f887 mais je n arrive pas a trouve le programme pour le faire fonctionne normalement je programme avec mikro c for pic et j aimerai avoir le bon programme.

j'utilise un capteur de température LM35 raccordé à l’entrée RA0/AN du pic avec un afficheur LM016L. en effet l'afficheur affiche bien thermomètre électronique pendant 6ms comme indique dans le programme et après il plante .


voila mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
sbit LCD_RS at Rb4_bit;
 
sbit LCD_EN at Rb5_bit;
 
sbit LCD_D4 at Rb0_bit;
 
sbit LCD_D5 at Rb1_bit;
 
sbit LCD_D6 at Rb2_bit;
 
sbit LCD_D7 at Rb3_bit;
 
sbit LCD_RS_Direction at TRISb4_bit;
 
sbit LCD_EN_Direction at TRISb5_bit;
 
sbit LCD_D4_Direction at TRISb0_bit;
 
sbit LCD_D5_Direction at TRISb1_bit;
 
sbit LCD_D6_Direction at TRISb2_bit;
 
sbit LCD_D7_Direction at TRISb3_bit;
 
float temp_res;
 
int volt;
 
char txt[10];
 
float b=40;
 
int i;
 
void main() {
 
    Lcd_Init();
 
    Lcd_Cmd(_LCD_CURSOR_OFF);
 
    Lcd_Cmd(_LCD_CLEAR);
 
    trisa=0xff;
 
    trisb=0;
 
    lcd_out(1,1,"THERMOMETRE ");
 
    lcd_out(2,1,"ELECTRONIQUE ");
 
    delay_ms(600);
 
    Lcd_Cmd(_LCD_CLEAR);
 
    delay_ms(1000);
 
    while (1){
 
        adcon1=0b10000000;
 
        adcon0=0b10000101;
 
        volt = ADC_Read(0);
 
        temp_res=(0.488 * volt);
 
        FloatToStr(temp_res, txt);
 
        lcd_Out(2, 4, txt); lcd_out(1,1,"LA TEMPERATURE");
    } 
}

voila la réalisation du montage :
Nom : THERMOMETRE ELECTRONI.png
Affichages : 2071
Taille : 90,9 Ko