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.


 
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

merlin2049er

Well-Known Member
Licensed User
Longtime User
ph.SetScreenOrientation (1)

found this in the forum.. should keep the screen in portrait only mode.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…