Missing SoftwareSerial, even though it is installed

It seems using my Arduino Due, that SoftwareSerial.h is not working, even though I can clearly see it installed in the main Arduino directory.

Anyone else have this experience?

The SoftwareSerial library you found in the Arduino IDE installation folder is part of the Arduino AVR Boards hardware package, which is included with the Arduino IDE. The libraries bundled with hardware packages are only accessible when a board of that package is selected from the Tools > Board menu. Since the Due is part of the Arduino SAM Boards package it can not access the library in the Arduino AVR Boards package. This makes sense because the SoftwareSerial library is architecture specific and would not compile for Due anyway.

Unfortunately there is no SoftwareSerial library included with the Arduino SAM Boards package. The Due does have four hardware serial ports so it's hard to believe you would actually need to use software serial. If you really do I did see there are some 3rd party software serial libraries for Due, which you will find after a little searching on Google.

Well, the main reason I wanted to use that library is that I have an HC-60 Bluetooth modue that I had bought for my Due to use as a way to transmit audio from the Due to a speaker.

Is there any other library that I should be using for that purpose?

That's not a valid reason. You can use hardware serial with bluetooth modules. In fact that is a reason why you would much prefer hardware serial because it won't support as high a baud rate.

GregTheHun:
Is there any other library that I should be using for that purpose?

Other than what? SoftwareSerial?

HI,
What are you doing with all the serial i/o on the DUE?


Tom.. :slight_smile:

Well, the first thing I wanted to try and do with the Bluetooth device is get it connected to an iPhone or smart phone of the Apple or Google variants so I can pass audio to it.

GregTheHun:
Well, the first thing I wanted to try and do with the Bluetooth device is get it connected to an iPhone or smart phone of the Apple or Google variants so I can pass audio to it.

So what is wrong with using one of the four hardware serial ports on the Due ?

I will admit, I'm a total newbie, I'm very tech saavy. This is my first forray into trying to work with an Arduino platform. So, this is me essentially stumbling around in the dark trying to get a bluetooth module, a touchscreen, and an SD card reader working on a Due because it's supposed to be better about playing audio back.

I may end up getting an MP3 module as well (unless there is an m4a/aac module I can use, or both)

Carry on then, secure in the knowledge that you can use the Bluetooth module with hardware serial.

If you run into any problems along the way feel free to come on back to the forum and we'll see what we can do.

So, as a quick question, what libraries would I need to include (if any) to use hardware serial?

I see a lot of different examples online for the different types of things I want to do for my project, but a lot of them point out that I need SoftwareSerial. I don't know how easy it would be to translate some of that code for it to work on a Due.

Essentially I want to be able to pass audio to the bluetooth module from an iPhone/Android phone and I have no idea where to start on a Due.

Thank all! :smiley:

GregTheHun:
So, as a quick question, what libraries would I need to include (if any) to use hardware serial?

None, hardware serial is part of the Arduino core library. You can find all the information you need here:

GregTheHun:
I see a lot of different examples online for the different types of things I want to do for my project, but a lot of them point out that I need SoftwareSerial.

The most common Arduino board is the Uno and so many of the tutorials you find are written for Uno. The Uno only has one hardware serial port, which is used for communication with the computer over the USB connection, including for uploads. For that reason if you need to communicate with an accessory device over serial using an Uno it makes sense to use software serial. That doesn't mean you need software serial, it's just all they had to work with. Nobody would ever use software serial if they had the option to use hardware serial.

GregTheHun:
Essentially I want to be able to pass audio to the bluetooth module from an iPhone/Android phone and I have no idea where to start on a Due.

You should probably start with some simple experiments to get acquainted with programming and electronics. You can find example sketches in the Arduino IDE at File > Examples and the tutorials that go with them here:
http://www.arduino.cc/en/Tutorial/HomePage

Next, you should break your project into its individual parts and get each part working separately, making sure you completely understand all the code.

Once you have each part working individually you can start combining them together.

It's very important to work through a project incrementally instead of just trying to slap the whole thing together at one time because then when it doesn't work you will have no clue what's wrong.

Great advice, thank you.

So, do you know anything about programming a Bluetooth HC-06 device? Or where I should begin?

Thanks once again.

GregTheHun:
where I should begin?

I would start by writing a minimal "hello world" sketch that just sends some data over Bluetooth. Save that sketch to use for testing purposes later if you need to do troubleshooting. It's always nice to have a quick sanity check when things are going wrong with the complex project to ensure that, yes, the Bluetooth module is still working.

Hi,

google Bluetooth arduino due

Tom.. :slight_smile: