Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:08 13 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Maximite to Android using JY-MCU

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 12:17am 12 Apr 2015
Copy link to clipboard 
Print this post

Hi all,

Have spent several days playing (fighting ) with a JY-MCU serial to bluetooth module so I can send data from a Colour Maximite to an Android tablet.

The module, shown below, is a JY-MCU unit. It has a bluetooth device name of linvor, connects at 9600, 8, N,1

On the CMM, I used the following code

open "com1:" as #2
do
print "Text to be sent to the tablet",#2
pause 2000
loop


On the tablet the following code will connect to the JY-MCU then loop waiting for data from the CMM





The code for the Android tablet is written in drBasic - this is free and available from http://laughton.com/basic/


!!
Routine to Get message String from external Bluetooth source
Code written in drBasic For Android tablet
Returns With String in csmsg$ And ndflag Set
!!
ndflag = 0 % new data
! BT Open will request bluetooth device - Select linvor
BT.OPEN
BT.CONNECT
DO
BT.STATUS s
UNTIL s = 3
! status 3 means connected
Do
BT.STATUS s
UNTIL s = 3
BT.STATUS S
!!
This first Do loop will keep repeating until returned status is Not 3
ie. the bluetooth link is down
!!
Do
Do
BT.READ.READY rr1
until rr1 <> 0
pause 100 % needed to allow bluetooth message to stabilise
Do
rmsg$ = ""
csmsg$ = ""
BT.READ.READY rr
while rr <> 0
BT.READ.READY rr
BT.READ.BYTES rmsg$
csmsg$ = csmsg$ + rmsg$
repeat
UNTIL rr = 0
ndflag = 1
!!
csmsg$ contains the String of characters sent in by bluetooth
- remove this when you actually use the code
!!
Print csmsg$
BT.STATUS S
!!
This is the End of the Do loop that tests status
!!
Until S <> 3


Any questions, feel free to PM me or ask on the forum.

Cheers,
Doug.
Edited by panky 2015-04-13
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 12:37am 12 Apr 2015
Copy link to clipboard 
Print this post

Sorry, thought of a couple more things-

you need to pair the JY-MCU with the Android tablet first - it will show up on the tablet after a scan as linvor

Prior to the connection in the Android program, the red led on the JY-MCU will be flashing - once connected, the red led will go on solid.

Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2933
Posted: 01:50am 12 Apr 2015
Copy link to clipboard 
Print this post

Hi Doug,

How much have you used DrBasic for creating Android code? Is it 'stable' (I mean the code - not the BlueTooth connection ).

Would love to hear more about your BlueTooth stuff once you have played with it more.

WW
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 07:54pm 12 Apr 2015
Copy link to clipboard 
Print this post

@Phil,

From a mate of mine who has used it a bit...

"I havent had any problems with it, other than if it is left open for a prolonged time. If I have run a program and left it open over night or so, it will possibly crash as I reopen the task. I have not produced a standalone app with it, I just run my programs from within it."

I am working on a display front end using the graphics of the Android tablet - will send a copy once I integrate the bt input code.

cheers,
doug


... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025