Bonjour à tous le monde,
je suis nouveau et je vous remercie de prendre un peu de votre temps pour ce post. Je ferai court donc.
En essayant de déboguer avec C18 dans l'environnement MPLAB IDE de Microchip ce message me sort
C:\Documents and Settings\Willy\Mes documents\Programmation\Microchip\pic18f2520.c:37:Error: syntax error
J'espère ne pas m'être trompé bètement :
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
/*Bibliothèques*/
#include<p18f2520.h>
#include<stdio.h>
 
/*Equivalences*/
#define LED1 PORTB<0>
#define LED2 PORTB<1>
#define LED3 PORTB<2>
#define LED4 PORTB<3>
#define BOUTON PORTA<4>
 
/*Prototypes de fonctions*/
void tempo();
void initialisation();
 
 
void initialisation()
{
	TRISA=1;			//PORTA configuré en entrée
	TRISB=0;			//PORTB configuré en sortie
	PORTB=0; 			//initialise l'etat des LEDs
	return;				//fin de fonction
}
 
void tempo()
{
	unsigned short i,j;			//déclaration de la variable
	for (i=0;i<5;i++)
		for (j=0;j<45500;j++); 	//tempo
	return;						//fin de fonction
}
 
int main(void)
{
	int count=0;
	initialisation();
	if(BOUTON=1)	//attendre l'appui du bouton
		for(count=0;count<5;count++)			//boucle de 5 tours
			{
				LED1=1;			//allumer LED1
				tempo();		//lancer la tempo
				LED1=0;			//eteindre LED1
				LED2=1;			//allumer LED2
				tempo();		//lancer la tempo
 
				LED2=0;			//eteindre LED2
				LED3=1;			//allumer LED3
				tempo();		//lancer la tempo
				LED3=0;			//eteindre LED3
				LED4=1;			//allumer LED4
				tempo();		//lancer la tempo
				LED4=0;			//eteindre LED4
				tempo();		//lancer la tempo
 
			}
	return 0;
}
Je vous remercie d'avance pour vos réponses.