Go Down

Topic: Am I giving the Arduino too much data? (Read 583 times) previous topic - next topic


Jul 13, 2008, 12:34 am Last Edit: Jul 13, 2008, 06:17 pm by Yes Reason: 1
When I get input from Serial.read(), it's the ASCII value for whatever key was hit.  Is there a way to get the "plain text" character input?  Like, instead of getting '97' when I hit 'a', can I just get 'a'?


New question:  I wrote a program that's supposed to get some input from Serial.read(), and then play the morse code for the text through a speaker.  I have an array for each letter of the alphabet that has numerical representations for dots or dashes.  But when I ran the program, nothing happened.  I put an LED in and tried having it blink at the beginning of the loop() method, and nothing happened.  But when I commented everything out so only the code for the LED was left it worked.  Right now I'm uncommenting the arrays one at a time and then sending, and the LED keeps blinking.  What's going on?

e:  Also, when I print one of the letter arrays, it just prints out zeros instead of what's actually in the array.  For example, if I declare and initialize o as 'int o[] = {2, 2, 2};' and then print that, it prints out three zeros.  I just print them in a for loop with Serial.println(), anybody know what's happening?



I'm not sure what you're asking.  Setting:

char character = 'a';

is the exact same thing as setting

char character = 97;

When you hit 'a', you do get an 'a'...

- Ben


Oh... oops.  That was stupid of me.



That was stupid of me.

Nah, not at all--there's a difference between not understanding something and being stupid. No need to be so quick to put yourself down. :-)

Or, as I read once somewhere: "you gotta be pretty smart before you can even start being this stupid." :D



Jul 13, 2008, 06:02 pm Last Edit: Jul 14, 2008, 02:12 am by Yes Reason: 1
I know, but I did understand =/

Thanks, new question  ;D

Nevermind, I got it.  I think it was running out of RAM.

Go Up