bluetooth souce selector

Charlie_M

Member
Licensed User
Longtime User
Hi merlin2049er,

I think you will want to use inputStream and OutputStream to send and receive data. I will be where you are once I get my BT modules. I hope its not too hard to get them to send and receive data.
 
Upvote 0

Graham

Member
Licensed User
Longtime User
You will send a string of numbers. Your Arduino will listen to the BT then your Arduino code will interpret that numbers as either a variable or a command.

Here is psuedocode.

The Arduino receives 0,1,150,300

The Arduino code knows the first value is to turn on/off a light (0-Off/1-On)
Second value is for the second light.
Third value is motor one RPM and fourth value is motor two rpm.

So your Arduino code turns off light one, turns on light two, adjusts PWM for motor one to run 150RPM and second motor to run 300RPM.


ok, I'm not even at the point of being able to send 'b1' or 'b2' or 'b3' or 'b4'.

Do I need some additional library, or can you point me to some code?

I've figured out how to pair it with a mac address and passkey. I'll some how merge that app into mine.

Then, I'll be able to send the commands on each button press.
 
Upvote 0

merlin2049er

Well-Known Member
Licensed User
Longtime User
My arduino sketch works, and I know which codes to send it.

Just need to send those commands in basic4android. I'll look at the input stream / output stream that had been mentioned.
 
Upvote 0

merlin2049er

Well-Known Member
Licensed User
Longtime User
I was able to merge my source selector with the bluetooth pairing demo.
I've got to check to see it it works.

Is there a way to see if bluetooth is turned on? If not, I can send a message box telling the user to enable it.
 
Upvote 0

merlin2049er

Well-Known Member
Licensed User
Longtime User
Just noticed when I flip my phone sideways (landscape) my buttons get cut off.

Is there a simple fix for that? Like enabling scrollbars?
 
Upvote 0
Top