Go Down

Topic: How to send data via Bluetooth from Arduino to Android App(gnrtd by Processing) (Read 4087 times) previous topic - next topic

burakozen

Hello ,  i generated an android application using Processing   in order to control Stepper motor and Bulb through Buttons. via Bluetooth HC-05
So far  i just have sent  data to Arduino via bluetooth module. now  i want to get data from arduino , for instance temperature information , i want to get value from arduino and display it on my Processing android app  .
in first case , i used to Bluetooth module in SLAVE mode . i think in second case ( i mean get data from arduino for temperature)
i must use bluetooth module in Master mode . my main question is i dont know  Can i use bluetooth module in SLAVE and MASTER mode simultaneously  ?
Code: [Select]
blueToothSerial.print("\r\n+STWMOD=0\r\n");/ set the bluetooth in slave mode
thanks in advance

Nick_Pyner

Quote
Can i use bluetooth module in SLAVE and MASTER mode simultaneously  ?


The short answer is probably no, but I don't think you need the bluetooth to be master anyway. Android is the master and you only need one.  I doubt the involvement of Processing changes anything. If it does, there are plenty of apps that don't, which will probably make life easier.

burakozen

thanks for replying , so you say i dont need to change anything(slave or master )  , i 'll try to get data from sensor and assignment a variable , then define in Processing sketch and display it how ever I want . im right ?

CrossRoads

Please don't post the same thing in numerous places. Post 1 time, have some patience.
Duplicate  post is being deleted.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

burakozen

im sorry but i thought second title is more suitable for my issue . i will be careful much more .

Nick_Pyner


thanks for replying , so you say i dont need to change anything(slave or master )  , i 'll try to get data from sensor and assignment a variable , then define in Processing sketch and display it how ever I want . im right ?


As far as Arduino is concerned, at most it is
Code: [Select]

Get sensorReading;
var =  sensorReading;
Serial.println (var);

or the like. No master needed.

burakozen

:( okay i can print the variable to serial monitor . but i dont know how to get it on  android application via bt . i attached  my processing code . Please help me about what to add the sketch.

Nick_Pyner


Please help me about what to add the sketch.


It all looks too complicated to me and deletions might be more in order than  additions. This background might be useful.

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

Go Up