system
December 2, 2014, 5:31pm
1
Hi!
I'm doing a project and i had a huge problem I wish you could help me.
The problem is:
I receive from pin 8 of the arduino a message like "hello"
that pin have been defined correctly in the setup.
In the loop i have this:
char val;
val=digitalRead(rxpin);
Serial.write(val);
This write a "hello" but I just want to write a simple character, just one, like 'h' or 'o', I tried doing that:
char val;
val=digitalRead(rxpin);
Serial.write(val[1]); -- It stills write "hello"
How i could do to write just one character of this "hello"?
Thank you to read my problem!
subirana21:
val=digitalRead(rxpin);
Serial.write(val);
This write a "hello" but I just want to write a simple character, just one, like 'h' or 'o', I tried doing that:
your reading a char using digitalRead()?
normally digitalRead() returns high or low.
system
December 2, 2014, 5:36pm
3
I know that digitalRead() return a HIGH or LOW, but i could read the "hello" message, and i don't know how to write just a character
KenF
December 2, 2014, 5:50pm
4
I receive from pin 8 of the arduino a message like "hello"
That's a neat trick
It's a digital pin. Under normal circumstances you won't find a uart attached to it.
system
December 2, 2014, 5:58pm
5
So, any solution to read from a pin the string "hello"??
system
December 2, 2014, 6:01pm
7
SoftwareSerial? i don't find it in Arduino libraries, where i can find it? and how it works? Thank you!
system
December 2, 2014, 6:04pm
8
subirana21:
SoftwareSerial? i don't find it in Arduino libraries, where i can find it? and how it works? Thank you!
you're not looking hard enough.
It took me way less time than the 90 seconds you spent on it.
KenF
December 2, 2014, 6:10pm
9
subirana21:
SoftwareSerial? i don't find it in Arduino libraries, where i can find it? and how it works? Thank you!
Think this through, WHY do you want to read it on pin 8. Why not use the Serial port instead?
Also how are you going to put "hello" on pin 8 in the first place?
Robin2
December 2, 2014, 7:50pm
10
How about posting the full code that allows you to get that strange message from pin 8? Then maybe we could understand what is going on and give some useful advice.
And use code tags so
the code looks like this
...R