lamino77
Newbie
![](//www.technologuepro.com/modules/Forum/images/rank/star1.gif)
![](//www.technologuepro.com/modules/User/images/noavatar.gif)
Messages : 7 Inscrit(e) le: 13/04/2013
|
Posté le 29/04/2013 09:02 | | aide pour affichage en deux chiffres aprés la virgule |
jai ce programme il fonctionne parfaitement je veut améliorer l'affichage pour le rendre sur de chiffre aprés mla virgule exemple : 12.56 A
merci
// LCD module connections sbit LCD_RS at RB2_bit; sbit LCD_EN at RB3_bit; sbit LCD_D4 at RB4_bit; sbit LCD_D5 at RB5_bit; sbit LCD_D6 at RB6_bit; sbit LCD_D7 at RB7_bit;
sbit LCD_RS_Direction at TRISB2_bit; sbit LCD_EN_Direction at TRISB3_bit; sbit LCD_D4_Direction at TRISB4_bit; sbit LCD_D5_Direction at TRISB5_bit; sbit LCD_D6_Direction at TRISB6_bit; sbit LCD_D7_Direction at TRISB7_bit;
unsigned amper_unit;
short amper_out ; char res[5];
void main(){
TRISA = 0xFF; TRISB = 0 ;
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR); Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Out(1,4,"AMPERMETRE");
Lcd_Out(2,1,"amp : ");
while (1) { amper_unit = ADC_read(0); amper_out = ((0.049*amper_unit)-25) ; Delay_ms(1); shortToStr(amper_out,res); Lcd_Out(2,10,res); Lcd_Chr_Cp('A');
} }
|
|
|