I have a Mega2560, i have just added a bluetooth module from Sparkfun: https://learn.sparkfun.com/tutorials/using-the-bluesmirf?_ga=1.218309661.584573556.1417027436
However I have done exactly as the tutorial shows however I am not receiving any data on the serial, this was true even before I added the bluetooth module. For example if i just upload a simply program with a line saying Serial.print etc i still do not have anything show up in the serial monitor. I also had a program which was supposed to read from the serial monitor however this also didnt work.
I was just wondering whether there is something simple I am missing out here?
kcajlliw:
For example if i just upload a simply program with a line saying Serial.print etc i still do not have anything show up in the serial monitor.
Is this happening when nothing is connected to any of the Mega pins? - in which case that is the first issue to resolve before doing anything about bluetooth.
On the other hand if it only happens when the bluetooth module is connected I suspect you are trying to use the Bluetooth with pins 0 and 1 (which belong to the USB connection) rather than connecting the bluetooth module to Serial1 which uses pins 18 and 19.
Thanks for both of your replies. Sorry for the delay.
I have got the serial working properly now. The only problem is that the character being read from the bluetooth is always showing as 255.
I am using pins 0 and 1, should i change these to 18 and 19?
(Sorry I started another topic as I didnt realise they were related)
Okay thanks. Sorry but just wondering why you have a symbol on the end of serial?
On the SoftwareSerial note - I am very novice with the arduino and this is what a tutorial suggested, but the tutorial was designed for an Arduino Uno. I am planning on moving the bluetooth system onto an Arduino uno when i have got it all working as it is going to be integrated into an electric car. Does the mega have an alternative?
You can't use Software Serial on the same pins (0 and 1) that Hardware Serial uses. And on a Mega you can't use it on pins 14 to 19 either - they are used by the 3 other Hardware Serials. And with all those Hardware Serials there is no need to use Software Serial at all on a Mega.