W
walid dhouioui
Guest
slt tt le monde je suis entrain de préparé mon pfe mais j'ai une probleme d'affichage, mon probléme : je crée un tableau matricielle 8*5 et je veux afficher un mot sur les leds mais lorsque je crée le programme il affiche la 1er carcatére c tt :-\ par exemple lorsque j'ai cée TITI sur la virtual terminal il affiche que la caractére T :-[
plizzzzzzzzz aider moi te m6
c'est mon programme:
#include "E:\sem31m1\pfe.h"
#include <string.h>
//#include <input.c>
char string [26];
int i , j,l;
char c,d;
const int8 FONT[26][5] = {0x3F,0x48,0x88,0x48,0x3F, //A
0xFF,0x89,0x89,0x89,0x66, //B
0x7E,0x81,0x81,0x81,0x81, //C
0xFF,0x81,0x81,0x81,0x7E, //D
0xFF,0x91,0x91,0x91,0x91, //E
0xFF,0x88,0x88,0x88,0x88, //F
0x7E,0x81,0x8D,0x8D,0x8F, //G
0xFF,0x10,0x10,0x10,0xFF, //H
0x81,0x81,0xFF,0x81,0x81, //I
0x07,0x81,0xFE,0x80,0x00, //J
0xFF,0x08,0x14,0x22,0x41, //K
0xFF,0x01,0x01,0x01,0x01, //L
0xFF,0x40,0x20,0x40,0xFF, //M
0xFF,0x10,0x08,0x04,0xFF, //N
0x7E,0x81,0x81,0x81,0x7E, //O
0xFF,0x90,0x90,0x90,0x60, //P
0x7E,0x81,0x85,0x83,0x7F, //Q
0xFF,0x88,0x8C,0x92,0x61, //R
0x80,0x80,0xFF,0x80,0x80, //T
0x33,0x49,0x49,0x45,0x43, //S
0xFE,0x01,0x01,0x01,0xFE, //U
0xFC,0x02,0x01,0x02,0xFC, //V
0xFE,0x01,0x06,0x01,0xFE, //W
0xC3,0x28,0x10,0x28,0xC3, //X
0xC0,0x20,0x0F,0x20,0xC0, //Y
0x83,0x85,0x91,0xA1,0xC1}; //Z
void main()
{
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);
// setup_oscillator(False);
debut:
{
printf ("\n \dooner les caractéres :\n ");
gets(string);
l= strlen(string);
printf(" %d long ",l);
printf ("\n %S \n\r",string);
printf(l+0x41);
}
set_tris_A(0);
set_tris_B(0XFF);
// set_tris_C(0X80);
port_B_pullups(1);
while(true)
{
if(input(pin_D0))
{
c=string-0x41;
for(i=0;i<l;i++)
{
for(j=0;j<5;j++)
{
if(input(pin_D0))
output_b(FONT[c][j]);
delay_ms(1000);
}
} goto stop;
}
stop:
output_b(0x00);
delay_ms(1000);}}
plizzzzzzzzz aider moi te m6
c'est mon programme:
#include "E:\sem31m1\pfe.h"
#include <string.h>
//#include <input.c>
char string [26];
int i , j,l;
char c,d;
const int8 FONT[26][5] = {0x3F,0x48,0x88,0x48,0x3F, //A
0xFF,0x89,0x89,0x89,0x66, //B
0x7E,0x81,0x81,0x81,0x81, //C
0xFF,0x81,0x81,0x81,0x7E, //D
0xFF,0x91,0x91,0x91,0x91, //E
0xFF,0x88,0x88,0x88,0x88, //F
0x7E,0x81,0x8D,0x8D,0x8F, //G
0xFF,0x10,0x10,0x10,0xFF, //H
0x81,0x81,0xFF,0x81,0x81, //I
0x07,0x81,0xFE,0x80,0x00, //J
0xFF,0x08,0x14,0x22,0x41, //K
0xFF,0x01,0x01,0x01,0x01, //L
0xFF,0x40,0x20,0x40,0xFF, //M
0xFF,0x10,0x08,0x04,0xFF, //N
0x7E,0x81,0x81,0x81,0x7E, //O
0xFF,0x90,0x90,0x90,0x60, //P
0x7E,0x81,0x85,0x83,0x7F, //Q
0xFF,0x88,0x8C,0x92,0x61, //R
0x80,0x80,0xFF,0x80,0x80, //T
0x33,0x49,0x49,0x45,0x43, //S
0xFE,0x01,0x01,0x01,0xFE, //U
0xFC,0x02,0x01,0x02,0xFC, //V
0xFE,0x01,0x06,0x01,0xFE, //W
0xC3,0x28,0x10,0x28,0xC3, //X
0xC0,0x20,0x0F,0x20,0xC0, //Y
0x83,0x85,0x91,0xA1,0xC1}; //Z
void main()
{
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);
// setup_oscillator(False);
debut:
{
printf ("\n \dooner les caractéres :\n ");
gets(string);
l= strlen(string);
printf(" %d long ",l);
printf ("\n %S \n\r",string);
printf(l+0x41);
}
set_tris_A(0);
set_tris_B(0XFF);
// set_tris_C(0X80);
port_B_pullups(1);
while(true)
{
if(input(pin_D0))
{
c=string-0x41;
for(i=0;i<l;i++)
{
for(j=0;j<5;j++)
{
if(input(pin_D0))
output_b(FONT[c][j]);
delay_ms(1000);
}
} goto stop;
}
stop:
output_b(0x00);
delay_ms(1000);}}