Micro c

Fermé
imene94 Messages postés 1 Date d'inscription samedi 1 avril 2017 Statut Membre Dernière intervention 1 avril 2017 - Modifié le 1 avril 2017 à 23:12
bonjour tout le monde je veux realiser une carte emettrice radiofrequence avec un pic 16f877,un lcd et un rf transmitter 433MHZ.
mais voila j'ai un probleme dans la programmation du pic au niveau de byte s=0;et je ne sais pas comment la regler;
// Lcd pinout settings
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB0_bit;

// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB0_bit;

void main() {

TRISB = 0;
PORTB = 0xFF;
TRISB = 0xff;
/*  Configurer E/S du portB comme  numériques*/
Lcd_Init();  //  Initialiser LCD
Lcd_Cmd(_LCD_CLEAR);  // Effacer un texte sur l'ecrant LCD
Lcd_Cmd(_LCD_CURSOR_OFF);  // Curseur est en  off
Lcd_Out(1,2,"--  AFFICHAGE --  ");     // Ecrire le texte sur la 1ère ligne
Lcd_Out(2,1,"display_LCD_4bit");     // Ecrire le texte sur la 2ème ligne
byte s=0;
lcd_init();
lcd_putc("\f");
setup_adc_ports(adc_clock_internal);
setup_adc(AN0);
set_adc_channel(0);
while(true)
   {
read_adc(adc_start_only);
while(!adc_done());
s=read_adc(adc_read_only);
lcd_gotoxy(1,1);
printf(lcd_putc, "\fTx Data=%u" s);
putc (s);
delay_ms(100);
    }
}

merci d'avance