Pages: [1]   Go Down
Author Topic: Am I giving the Arduino too much data?  (Read 526 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 3
Posts: 82
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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'?

Thanks.


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?

Thanks.

« Last Edit: July 13, 2008, 11:17:48 am by Yes » Logged

Las Vegas, NV
Offline Offline
God Member
*****
Karma: 0
Posts: 507
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


0
Offline Offline
Jr. Member
**
Karma: 3
Posts: 82
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thanks.
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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." smiley-grin

--Phil.
Logged

0
Offline Offline
Jr. Member
**
Karma: 3
Posts: 82
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know, but I did understand =/

Thanks, new question  ;D

Nevermind, I got it.  I think it was running out of RAM.
« Last Edit: July 13, 2008, 07:12:19 pm by Yes » Logged

Pages: [1]   Go Up
Jump to: