ZeleC
Full Member level 5

C HElp
hello
ive been working on a pic16f873 and a led matrix 5x7,i simulated my models using proteus isis , and im using mplab combined with picc from hi-tech,
well i managed to put numbers on my matrix,and it worked great,until i tried to change the number example from one to two , i want to do it with a pointer, well im not that good with pointers!and arrays!!
here is my code and ill try to show you waht i have done:
#include <pic.h>
void DelayMs(unsigned char);
void Pause (unsigned char);
void DelayS(unsigned char cnt);
char const one[7] = {0x04,0x0C,0x14,0x04,0x04,0x04,0x1F};
char const two[7] = {0x0E,0x11,0x01,0x02,0x04,0x08,0x1F};
char const zero[7] = {0x0E,0x11,0x13,0x15,0x19,0x11,0x0E};
char const minus[7] = {0x0E,0x11,0x13,0x15,0x19,0x11,0x0E};
char *DigitPtr;
//char upmotion;
main(){
unsigned char dly = 25;
TRISA = 0x00;
TRISB = 0x00;
TRISC = 0x00;
for(;
{
*DigitPtr = one;
col = 0x01;
//DelayMs(50);
for (int i = 0 ; i < 7; i++){
PORTB = zero;
PORTC = ~position;
DelayMs(1);
col <<=1;}
}}
So this was working great ,i tried to make a pointer to hold the array that i want for example to replace the zero by one in my loop but it didnt worked ,
So any help from you guys on how to do that .
I hope you have understood what i mean so nayhelp???
thank you for your time .
hello
ive been working on a pic16f873 and a led matrix 5x7,i simulated my models using proteus isis , and im using mplab combined with picc from hi-tech,
well i managed to put numbers on my matrix,and it worked great,until i tried to change the number example from one to two , i want to do it with a pointer, well im not that good with pointers!and arrays!!
here is my code and ill try to show you waht i have done:
#include <pic.h>
void DelayMs(unsigned char);
void Pause (unsigned char);
void DelayS(unsigned char cnt);
char const one[7] = {0x04,0x0C,0x14,0x04,0x04,0x04,0x1F};
char const two[7] = {0x0E,0x11,0x01,0x02,0x04,0x08,0x1F};
char const zero[7] = {0x0E,0x11,0x13,0x15,0x19,0x11,0x0E};
char const minus[7] = {0x0E,0x11,0x13,0x15,0x19,0x11,0x0E};
char *DigitPtr;
//char upmotion;
main(){
unsigned char dly = 25;
TRISA = 0x00;
TRISB = 0x00;
TRISC = 0x00;
for(;
*DigitPtr = one;
col = 0x01;
//DelayMs(50);
for (int i = 0 ; i < 7; i++){
PORTB = zero;
PORTC = ~position;
DelayMs(1);
col <<=1;}
}}
So this was working great ,i tried to make a pointer to hold the array that i want for example to replace the zero by one in my loop but it didnt worked ,
So any help from you guys on how to do that .
I hope you have understood what i mean so nayhelp???
thank you for your time .