A
angelomary
Guest
Bonjour tous:
je travaille dans mon projet de dernière année, je décide d'utiliser un pic16877a, sortie vers un Buzzers & 8 * 8 matricielle, je cherche à mettre en uvre mon projet en utilisant un simulateur protous mais il n'ya pas de sortie tandis que la figure indiquent qu'il ya une entrée de manière à se ma personne un mauvais code plz sais, mon code ci-dessous
programme locator2
void main ()
char oldstate1 = (0;
char oldstate2 = 0;
char oldstate3 = 0;
char oldstate4 = 0;
char i = 0;
Trisa = 0b00001111;
TRISB = 0x00;
trisc = 0x00;
trisd = 0x00;
trise = 0B000;
Porte = 0;
PORTC = 0;
PORTB = 0;do (
if (Button (& PORTA, 0, 1, 1)) / / détecter une logique sur RA0 broches
oldstate1 = 1;
if (oldstate1 & & Button (& PORTA, 0, 1, 0)) / / detect one-to-zero transition sur RA0 broches
(
porte.f0 = ~ porte.f0; / / nie valeur sur RE0
oldstate1 = 0;
)
) Alors que (1); / / boucle sans findo (
if (Button (& PORTA, 1, 1, 1)) / / détecter une logique sur la broche RA1
oldstate2 = 1;
if (oldstate2 & & Button (& PORTA, 1, 1, 0)) / / détecte un à zéro en transition sur la broche RA1
(porte.f1 = ~ porte.f1; / / nie valeur sur RE0
0 = oldstate2;
)
) While (1) / / boucle sans findo (
if (Button (& PORTA, 2, 1, 1)) / / détecter une logique sur la broche RA2
oldstate3 = 1;
if (oldstate3 & & Button (& PORTA, 2, 1, 0)) / / detect one-to-zero transition sur la broche RA2
(
if (i = 0) (
PORTC = 0b11001100;
PORTB = 0b01010110;
i = i 1;
)
if (i = 1) (
PORTC = 0b01001100;
PORTB = 0b01011110;
i = i 1;
)
if (i = 2) (
PORTC = 0b00001100;
PORTB = 0b11011110;
i = i 1;
)
if (i = 3) (
PORTC = 0b01100100;
PORTB = 0b11010110;
i = i 1;
)
if (i = 4) (
PORTC = 0b01011100;
PORTB = 0b11000110;
i = 0;
)
0 = oldstate3;
)
) while (1) / / boucle sans findo (
if (Button (& PORTA, 3, 1, 1)) / / détecter une logique sur la broche RA3
oldstate4 = 1;
if (oldstate4 & & Button (& PORTA, 3, 1, 0)) / / detect one-to-zero transition sur la broche RA3
(If (i = 0), (
PORTC = 0b01001100;
PORTB = 0b11100111;
i = i 1;
)
if (i = 1) (
PORTC = 0b01010100;
PORTB = 0b11110110;
i = i 1;
)
if (i = 2) (
PORTC = 0b01101101;
PORTB = 0b11010100;
i = i 1;
)
if (i = 3) (
PORTC = 0b01011100;
PORTB = 0b11011010;
i = i 1;
)
if (i = 4) (
PORTC = 0b01101110;
PORTB = 0b10010110;
i = 0;
)
oldstate4 = 0;
)
) while (1) / / boucle sans fin
)Ajouté après 4 minutes:ici aussi, c'est mon circuit<img src="http://images.elektroda.net/87_1260126451_thumb.jpg" border="0" alt="help me with a pic16877a" title="Aidez-moi avec une pic16877a"/>
je travaille dans mon projet de dernière année, je décide d'utiliser un pic16877a, sortie vers un Buzzers & 8 * 8 matricielle, je cherche à mettre en uvre mon projet en utilisant un simulateur protous mais il n'ya pas de sortie tandis que la figure indiquent qu'il ya une entrée de manière à se ma personne un mauvais code plz sais, mon code ci-dessous
programme locator2
void main ()
char oldstate1 = (0;
char oldstate2 = 0;
char oldstate3 = 0;
char oldstate4 = 0;
char i = 0;
Trisa = 0b00001111;
TRISB = 0x00;
trisc = 0x00;
trisd = 0x00;
trise = 0B000;
Porte = 0;
PORTC = 0;
PORTB = 0;do (
if (Button (& PORTA, 0, 1, 1)) / / détecter une logique sur RA0 broches
oldstate1 = 1;
if (oldstate1 & & Button (& PORTA, 0, 1, 0)) / / detect one-to-zero transition sur RA0 broches
(
porte.f0 = ~ porte.f0; / / nie valeur sur RE0
oldstate1 = 0;
)
) Alors que (1); / / boucle sans findo (
if (Button (& PORTA, 1, 1, 1)) / / détecter une logique sur la broche RA1
oldstate2 = 1;
if (oldstate2 & & Button (& PORTA, 1, 1, 0)) / / détecte un à zéro en transition sur la broche RA1
(porte.f1 = ~ porte.f1; / / nie valeur sur RE0
0 = oldstate2;
)
) While (1) / / boucle sans findo (
if (Button (& PORTA, 2, 1, 1)) / / détecter une logique sur la broche RA2
oldstate3 = 1;
if (oldstate3 & & Button (& PORTA, 2, 1, 0)) / / detect one-to-zero transition sur la broche RA2
(
if (i = 0) (
PORTC = 0b11001100;
PORTB = 0b01010110;
i = i 1;
)
if (i = 1) (
PORTC = 0b01001100;
PORTB = 0b01011110;
i = i 1;
)
if (i = 2) (
PORTC = 0b00001100;
PORTB = 0b11011110;
i = i 1;
)
if (i = 3) (
PORTC = 0b01100100;
PORTB = 0b11010110;
i = i 1;
)
if (i = 4) (
PORTC = 0b01011100;
PORTB = 0b11000110;
i = 0;
)
0 = oldstate3;
)
) while (1) / / boucle sans findo (
if (Button (& PORTA, 3, 1, 1)) / / détecter une logique sur la broche RA3
oldstate4 = 1;
if (oldstate4 & & Button (& PORTA, 3, 1, 0)) / / detect one-to-zero transition sur la broche RA3
(If (i = 0), (
PORTC = 0b01001100;
PORTB = 0b11100111;
i = i 1;
)
if (i = 1) (
PORTC = 0b01010100;
PORTB = 0b11110110;
i = i 1;
)
if (i = 2) (
PORTC = 0b01101101;
PORTB = 0b11010100;
i = i 1;
)
if (i = 3) (
PORTC = 0b01011100;
PORTB = 0b11011010;
i = i 1;
)
if (i = 4) (
PORTC = 0b01101110;
PORTB = 0b10010110;
i = 0;
)
oldstate4 = 0;
)
) while (1) / / boucle sans fin
)Ajouté après 4 minutes:ici aussi, c'est mon circuit<img src="http://images.elektroda.net/87_1260126451_thumb.jpg" border="0" alt="help me with a pic16877a" title="Aidez-moi avec une pic16877a"/>