Sending ASCII value to function

Hi,

I'm trying to figure out how to send the ASCII value of a char to a function.

Basically I have a 2D array of the following structure:

asciitable[asciivalue][5x7ledbin]
void sendtodisplay(char character){
    for(int i = 0; i<5; i++){
    lc1.setRow(0,i,asciitable[character][i]);}}

I know I can declare

char whatever = 'a';

but how can I handle that more generally within functions.

Any good reference, I'm missing the keywords to do a relevant search in google. I feel like I'm struggling to handle the logic behind strings and char and numbers and how it's handled

Any help is welcome

Define what you mean by "ASCII Value". Do you mean the numeric value of a given ASCII character?

How about this?

char msg[] = "Hello World!";
sendtodisplay(msg[0]);
char c = Serial.read();
sendtodisplay(c);

DuzMontana:
Basically I have a 2D array of the following structure:

If you compare your original post with your actual code you'll understand why the Sticky posts in this section ask you to enclose your code in code tags. You can add them now by editing your first post, selecting your code and clicking the # button in the edit window.

Yes, the numerical value of a given character. Ex. 'A' = 65

I'm not sure I get what the following line does.

char c = Serial.read();

DuzMontana:
Yes, the numerical value of a given character. Ex. 'A' = 65

I'm not sure I get what the following line does.

char c = Serial.read();

First read this...

Then read this...

how to send the ASCII value of a char to a function

.. is the same as
how to send a char to a function

If a char variable is used to represent a character, then it contains the ASCII code for that character. You don't need to do anything special to pass the ASCII code to a function, just pass the variable. It already contains the ASCII code.

Thanks for the reading, this was helpful, got me on the right path.

I realize that my post was ambiguous. Just to summarize what I'm trying to do:

I want to be able to send digits and characters in their decimal ASCII representation to an array (eg. 'A' = 65, '1' = 49).

After reading the links I reached the string constructor page
http://arduino.cc/en/Reference/StringConstructor

let me know if this code makes sense:

int n = 1;
char m = 'a';

//array of binaries values for 5x7 display to send to MAX7219 ordered in increasing decimal ASCII value
long asciitable[asciivalue][5x7ledBin];  

String character1 = String(n);
String character2 = String(m);

void sendtodisplay(int character){  //can I declare character as an int? I'll need an int in the array?
    for(int i = 0; i<5; i++){
    lc1.setRow(0,i,asciitable[character][i]);
    }
}

void loop(){
      sendtodisplay(character1);
      delay(1000);
      sendtodisplay(character2);
      delay(1000);
}

DuzMontana:
I want to be able to send digits and characters in their decimal ASCII representation to an array (eg. 'A' = 65, '1' = 49).

char myChar = 'A';
char myChar = 65;

Both lines accomplish the same thing.

Or in other words 'A' is just another way to write 65. Just like you could also write it as 0x41. They all represent the exact same thing.

Computers don't do letters. Only numbers. That's why ASCII was created in the first place.

My problem, if we can call this a problem, is more when '1' = 49 (I feel dirty just saying it)

Thanks for all your help