PIC16F877
Résolu
bchicta
-
t.toufikk Messages postés 5 Date d'inscription Statut Membre Dernière intervention -
t.toufikk Messages postés 5 Date d'inscription Statut Membre Dernière intervention -
J'ai 2 questions:
- comment programmer le pic 16F877 POUR recevoir une donnée reçu par une machine via RS232 et l'afficher sur un LCD?
- comment programmer le pic 16F877 POUR acceder (ouvrir et lire) au fichier dans une autre machine à travers RS232?
- comment programmer le pic 16F877 POUR recevoir une donnée reçu par une machine via RS232 et l'afficher sur un LCD?
- comment programmer le pic 16F877 POUR acceder (ouvrir et lire) au fichier dans une autre machine à travers RS232?
1 réponse
#include "C:\Users\toufik\Desktop\projet detudes.h"
void main()
{
int CAP1,CAP2;
#define CAP1(PIN_RA0);
#define CAP2(PIN_RA1);
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
// TODO: USER CODE!!
#fuses XT,NOWDT,NOPUT,NOPROTECT
#use delay(clock=4000000)
SET_TRIS_B (0b00000000);
SET_TRIS_A (0b11100000);
if (CAP1=1)
OUTPUT_HIGH(PIN_B3); \\assignment inside relational expression
else
{
Output_low(PIN_B3);
}
if (CAP2=1)
Output_high(PIN_B4 ) ; \\assignment inside relational expression
else{
Output_low (PIN_B4 ) ;
}
}
voila mon programme les variable CAP1 et CAP2 c'est la tension délivrée par les capteur mais un message s'affiche assignment inside relational expression
j'ai besoin d'aide SVP
void main()
{
int CAP1,CAP2;
#define CAP1(PIN_RA0);
#define CAP2(PIN_RA1);
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
// TODO: USER CODE!!
#fuses XT,NOWDT,NOPUT,NOPROTECT
#use delay(clock=4000000)
SET_TRIS_B (0b00000000);
SET_TRIS_A (0b11100000);
if (CAP1=1)
OUTPUT_HIGH(PIN_B3); \\assignment inside relational expression
else
{
Output_low(PIN_B3);
}
if (CAP2=1)
Output_high(PIN_B4 ) ; \\assignment inside relational expression
else{
Output_low (PIN_B4 ) ;
}
}
voila mon programme les variable CAP1 et CAP2 c'est la tension délivrée par les capteur mais un message s'affiche assignment inside relational expression
j'ai besoin d'aide SVP