hello friends I'm doing a 8x8 LED matrix with LPC1768 and when I compile I get an error that I can not solve also leave some warnings but I did not care much. could help me? I leave the whole project in keil
many thanks Ciernes
I do not understand what ascii is not a variable
Might you help me fix it
I do not know how to do well
other messages and I understand
thank you
So exactly what is ascii then? You are the only one who knows...
Maybe, just maybe, you should consider a book on the C programming language?
right now I'm learning and there are things that even I do not understand. I would appreciate very much if you could help me. is what is ascii. but not how to fix the code
you have a lot of experience I would like you to help me
While I do know the meaning of the term ASCII, I have no idea at all about what you main with your ascii[] in your code.
If it is your code, then you should know.
If it isn't your code, then that is a danger with getting someone elses code.
You have just posted where you make use of ascii[], but you haven't shown any declarations.
In all likelihood is describes the 8x8 bit map to be painted to the screen for the ASCII character set, @,A,B,C, etc
uint8_t smiley[] = {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C}; 0x3C 00111100 0x42 01000010 0xA5 10100101 0x81 10000001 0xA5 10100101 0x99 10011001 0x42 01000010 0x3C 00111100 0x3C #### 0x42 # # 0xA5 # # # # 0x81 # # 0xA5 # # # # 0x99 # ## # 0x42 # # 0x3C ####
Yes, that is quite likely. In which case it wouldn't have hurt if:
void Matrix_NewFrame(uint8_t array[8])
was taking a const parameter.
I'm a little bit surprised why a thread search in my browser didn't let me see these two lines:
const uint8_t ascii[][8] = 77 I do not write. It is very long
and
const uint8_t ascii[100][8];
this is my ascii code not what I'm doing wrong const uint8_t ascii[128][8] = {{0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //20 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //30 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //SPACE {0x0,0x4,0x4,0x4,0x4,0x0,0x4,0x0}, //! {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //40 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0}, //. {0,0,0,0,0,0,0,0}, {0x0,0x18,0x24,0x2C,0x34,0x24,0x18,0x0},//0 {0x0,0x18,0x14,0x10,0x10,0x10,0x3C,0x0},//1 {0x0,0x18,0x24,0x20,0x10,0x8,0x3C,0x0}, //2 {0x0,0x1C,0x20,0x18,0x20,0x20,0x1C,0x0},//3 {0x0,0x4,0x24,0x24,0x3C,0x20,0x20,0x0}, //4 {0x0,0x3C,0x4,0x1C,0x20,0x20,0x1C,0x0}, //5 {0x0,0x18,0x4,0x1C,0x24,0x24,0x18,0x0}, //6 {0x0,0x3C,0x20,0x10,0x10,0x8,0x8,0x0}, //7 {0x0,0x18,0x24,0x18,0x24,0x24,0x18,0x0},//8 {0x0,0x18,0x24,0x24,0x38,0x20,0x1C,0x0},//9 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //60 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0x0,0x18,0x24,0x20,0x10,0x0,0x10,0x0}, //? {0,0,0,0,0,0,0,0}, {0x0,0x18,0x24,0x24,0x3C,0x24,0x24,0x0},//A {0x0,0x1C,0x24,0x3C,0x24,0x24,0x1C,0x0},//B {0x0,0x38,0x4,0x4,0x4,0x4,0x38,0x0}, //C {0x0,0x1C,0x24,0x24,0x24,0x24,0x1C,0x0},//D {0x0,0x3C,0x4,0xC,0xC,0x4,0x3C,0x0}, //E {0x0,0x3C,0x4,0x1C,0x4,0x4,0x4,0x0}, //F {0x0,0x3C,0x4,0x4,0x34,0x24,0x3C,0x0}, //G {0x0,0x24,0x24,0x3C,0x3C,0x24,0x24,0x0},//H {0x0,0x1C,0x8,0x8,0x8,0x8,0x1C,0x0}, //I {0x0,0x3C,0x20,0x20,0x20,0x24,0x18,0x0},//J {0x0,0x24,0x14,0xC,0x14,0x24,0x24,0x0}, //K {0x0,0x4,0x4,0x4,0x4,0x4,0x1C,0x0}, //L {0x0,0x44,0x6C,0x54,0x54,0x54,0x54,0x0},//M {0x0,0x24,0x2C,0x2C,0x34,0x34,0x24,0x0},//N {0x0,0x18,0x24,0x24,0x24,0x24,0x18,0x0},//O {0x0,0x1C,0x24,0x24,0x1C,0x4,0x4,0x0}, //P {0x0,0x18,0x24,0x24,0x24,0x14,0x28,0x0},//Q {0x0,0x1C,0x24,0x24,0x3C,0x14,0x24,0x0},//R {0x0,0x38,0x4,0x18,0x20,0x20,0x1C,0x0}, //S {0x0,0x7C,0x10,0x10,0x10,0x10,0x10,0x0},//T {0x0,0x24,0x24,0x24,0x24,0x24,0x18,0x0},//U {0x0,0x24,0x24,0x24,0x24,0x24,0x18,0x0},//V {0x0,0x44,0x54,0x54,0x54,0x6C,0x44,0x0},//W {0x0,0x44,0x28,0x10,0x10,0x28,0x44,0x0},//X {0x0,0x24,0x24,0x24,0x18,0x10,0x10,0x0},//Y {0x0,0x3C,0x20,0x10,0x8,0x4,0x3C,0x0} ,//Z {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //100 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //110 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //120 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, //127 };
/* Array to define the width of a character */ const uint8_t character_length[128] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, //SPACE 1, //! 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //A 4, //B 4, //C 4, //D 4, //E 4, //F 4, //G 4, //H 3, //I 4, //J 4, //K 3, //L 5, //M 4, //N 4, //O 4, //P 4, //Q 4, //R 4, //S 5, //T 4, //U 4, //V 5, //W 5, //X 4, //Y 4, //Z 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //100 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //110 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //120 4, 4, 4, 4, 4, 4, 4, //127 };
matrix.h was wrong
this is the right
matrix.h
const uint8_t ascii[128][8]; const uint8_t character_length[128];
Did you read my comment about "const"?
Did you complement that comment by taking a closer look about the "const" keyword in any book about the C programming language?
Wow this is an uphill struggle...
{0x0,0x18,0x24,0x2C,0x34,0x24,0x18,0x0},//0 0x00 00000000 0x18 00011000 0x24 00100100 0x2C 00101100 0x34 00110100 0x24 00100100 0x18 00011000 0x00 00000000 0x00 0x18 ## 0x24 # # 0x2C # ## 0x34 ## # 0x24 # # 0x18 ## 0x00 {0x0,0x18,0x14,0x10,0x10,0x10,0x3C,0x0},//1 0x00 00000000 0x18 00011000 0x14 00010100 0x10 00010000 0x10 00010000 0x10 00010000 0x3C 00111100 0x00 00000000 0x00 0x18 ## 0x14 # # 0x10 # 0x10 # 0x10 # 0x3C #### 0x00
ok I get it. I removed the const and I changed uint8_t for unsigned char
I thought it was getting "const" the same as using "code" in 8051 microcontroller
unsigned char ascii[128][8]; unsigned char character_length[128];
but now it throws these errors:
Build target 'Target 1' compiling main.c... compiling matrix.c... linking... .\matriztest.axf: Error: L6200E: Symbol ascii multiply defined (by matrix.o and main.o). .\matriztest.axf: Error: L6200E: Symbol ascii multiply defined (by matrix_font.o and main.o). .\matriztest.axf: Error: L6200E: Symbol character_length multiply defined (by matrix.o and main.o). .\matriztest.axf: Error: L6200E: Symbol character_length multiply defined (by matrix_font.o and main.o). ".\matriztest.axf" - 4 Errors, 0 Warning(s). Target not created
many thanks for your patience
"ok I get it. I removed the const and I changed uint8_t for unsigned char"
Sorry, but you failed to get it.
Didn't you look for some good book about the C language?
Why do you think "const" is a keyword that is best to remove?
Why do you think we got "uint8_t" if it is better to use "unsigned char"?
What do you think the meaning is of "multiply defined"?
put unsigned char, because I read that e is 1 byte for characters 0-255 const use it to save data to flash and not take up ram unnecessarily. remove it to see if something managed. the multiply defined not understand
Just what do you think uint8_t means?
And what number of bits do you think "char" has on a machine that might possibly have 36-bit integers?
"const" to place things in flash? Do you think the computers did use flash, when the C language originally got a "const" keyword? Have you spent any time reading any chapter about "const" in a good book about the C programming language?
You want to remove "const", while lots of this worlds programmers would want more use of this keyword - maybe for a good reason.
But let's assume that "const" really would mean to store in flash - wouldn't that be good for you? Are you really in need of having character bitmap descriptions stored in flash, and then copied into RAM on program startup just so your program will be able to modify the bitmaps? Do you expect that your program has a need to modify these character bitmaps while running?