Hello!
I just started getting into the Arduino world over christmas break so I am a mega n00b.
I know there is the Serial Input Basics thread, but I'm not 100% sure if inside it is what I'm really looking for.
Basically, I am trying to set up a code that inputs a sentence via the serial monitor, (20 characters max including spaces) the arduino counts how many characters were sent (could be 1-20 characters), then converts those characters into numbers.
These numbers are going to be used to display certain letters on my 4-digit 7 segment LED display.
If anyone has some advice (even just some links to read) that would be super helpful! Theres so much information about serial communication it quickly becomes overwhelming for me.
Thanks,
Justin
Delta_G:
How? What letter becomes what number? Are you familiar with ascii? Your characters are already represented by numbers in memory. Are those the numbers you want?
I have a table filled with binary values, about 30. For my LED code, if I type in Display(0); and Digit1 is on, then on my LED display the first digit shows 0. Similarily, if I type in Display(24); the first digit shows the letter H, because in my table, the 24th digit is binary for the segments that display the letter H.
unsigned char table[]={
B00111111, //0
B00000110, //1
B01011011, //2
B01001111, //3
B01100110, //4
B01101101, //5
B01111101, //6
B00000111, //7
B01111111, //8
B01101111, //9
B01110011, //P
B00111000, //L
B01110111, //A
etc.
Delta_G:
And somehow you think that if we copy that and write it all out one more time on this thread that it will suddenly start making sense?
Uh...
Delta_G:
Why don't you try reading it and then you'll know for sure?
I did, before I posted this thread. But I didn't see:
- How to find the number of characters of a serial input (How many letters are in a sentence that is typed in)
- Converting those saved inputs into specific numbers that represent letters in my binary table
- Giving an error message if an invalid character is typed (for example, my display can't show a lowercase w, if that is typed in I need to have the serial monitor reply with "w is an invalid letter")