Go Down

Topic: SoftwareSerial with Mega pins confusion (Read 593 times) previous topic - next topic

Flynn

Hi guys,

I am a bit confused with assigning pins for SoftwareSerial. So I have Mega ADK board and a Bluetooth Silver Mater that I want to connect. I've seen examples of SoftwareSerial using pins 2-13 no problem. However, I have a motor shield which uses up those pins.

So I thought ok I'll just use other pins. Know, I've found that on mega, there is only a set of pins that you can use
Quote
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69


So at first I was a bit lost with 50-69 pins. But then I worked out that ok 63 = 15(RX3), 64 = 14(TX3). So I plugged the TX,RX pins into 14,15 and I thought of we go right?
Code: [Select]
SoftwareSerial bluetooth(15,14);
No.

No matter which pins I use, nothing gets received.

Can I not use these pins because they for Serial3? I am not using Serial3 anywhere.

Thanks in advance.

PaulS

Using the HardwareSerial pins to do software serial doesn't make sense. If the hardware serial pins are available, why are you not using one of the HardwareSerial instances?

SoftwareSerial is for boards that don't have 4 hardware serial ports.

Flynn


Flynn

Is there a place where I can read how to use HardwareSerial, cause I can't seem to find any examples or tutorials. Hmmmm


Thanks

retrolefty


Is there a place where I can read how to use HardwareSerial, cause I can't seem to find any examples or tutorials. Hmmmm


Thanks


Well there are lots of example sketches using serial in the files/Examples/Communications menu.
And the Serial library is pretty well documented here:

http://arduino.cc/en/Reference/Serial

Lefty

Flynn

I get it now. I did not realise Serial1, 2 and 3 were Instances of HardwareSerial. dough!

Go Up