Android Basic Alternative


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    No, what you transmit to is strictly set by pairing the 2 devices which is not part of this code. I don't think you can pair more than 2 devices. The header is just for validation of the data. The data received flag isn't raised until all data is received, without it the flag is raised as soon as data appears, and then you have to manually put the bytes into a string and wait until they all arrive.
    Shawn

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Quote Originally Posted by spcw1234 View Post
    No, what you transmit to is strictly set by pairing the 2 devices which is not part of this code. I don't think you can pair more than 2 devices. The header is just for validation of the data. The data received flag isn't raised until all data is received, without it the flag is raised as soon as data appears, and then you have to manually put the bytes into a string and wait until they all arrive.
    So let's say I have 2 garage door openers, I could pair with the phone, send that header and data defining if PIC should activate relay for left or right door button and then unpair phone?

    Just making sure I can get 2 phones to be able to open either door (project #1).

    Robert

  3. #3
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Hi Robert - don't feel concern about using the code I posted; they are happy to have people use it. It only works on "Enterprise" though, I'm pretty sure.

    The Bluetooth pairing with different devices is more a function of the module you use, I think. I've got a handful of cheap modules from offshore that I'm using with various PIC projects. you basically SERIN / SEROUT to the module and use the module like a serial port. I have paired/unpaired the same module to my development PC, my phone, and my old laptop, so it should happily do what you want. I'll dig back through my notes and post the device number if you wish.

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Yup, please, more info is good.

  5. #5
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Here you go:
    Bluetooth Module

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    I use the Roving Network bluetooth device. RN-42.

    It is pretty easy to use. I downloaded a serial port emulator for my android phone to configure it. Once I realized how the get the emulator to send the correct end of line character, it was pretty easy. The RN-42 allows you to rename the module, set BPS and a few other variables pretty easily.

    On the B4A side, the online support is great. Their forum is very active and there are a bunch of other developers willing to help you sort out a problem.

    Here are a couple of screen shots.

    http://www.grahamelectricplanter.com...5-20-08-52.png

    http://www.grahamelectricplanter.com...7-20-04-55.png

    I initially was using a Motorola Xoom and because of supply problems now use a Samsung Galaxy. Everything still works great.

    I will say the screen designer could use some touch up. Some basic, no pun intended...get it we are dealing with software called Basic for Android , is lacking. When setting up a screen you will be able to copy/paste yet not undo. I highly suggest 'Saving' the screen often. Other than that, it helped me quickly get an Android app going communicating with my PIC board.

  7. #7
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Quote Originally Posted by Demon View Post
    So let's say I have 2 garage door openers, I could pair with the phone, send that header and data defining if PIC should activate relay for left or right door button and then unpair phone?

    Just making sure I can get 2 phones to be able to open either door (project #1).

    Robert
    The only problem I see here is that it takes 30 seconds to pair up every time, might be able to do it faster but I haven't figured it out. That might not be a big deal, but not as simple as a normal garage door opener.
    Shawn

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    30 seconds would indeed suck.

  9. #9
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    After wrapping my brain around the problem, I finally stumbled across this thread.

    I am trying to almost exactly the same thing; display a packet of 6 bytes spit out by the pic on an Android, using B4A in 6 different boxes.

    The B4A side of things is completely unchartered territory for me; just figured out the advantages of using the prefix mode.

    Now, I have a few questions; Shawn, in post#16, you have defined the prefix length to 22. But the decimal digits add up to 25. How is that?

    As I said, my expertise on B4A is extremely mediocre; could you please show us the complete code on that side? For example, I am unclear (PLEASE forgive my complete ignorance, I suspect this is quite straightforward) how to fill up individual labels with the incoming data bytes from your Update_Display routine.

    Thanks!

    Anand

  10. #10
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Android Basic Alternative

    Quote Originally Posted by ardhuru View Post

    in post#16, you have defined the prefix length to 22. But the decimal digits add up to 25. How is that?
    Sorry, my mistake about the prefix length.

    Still struggling with the other aspect, though..

Similar Threads

  1. Android Basic
    By dhouston in forum Off Topic
    Replies: 14
    Last Post: - 16th February 2013, 02:47
  2. Pic to Android
    By l_gaminde in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th January 2012, 19:08
  3. PBP & Android Interfacing
    By lester in forum PBP & Amicus18
    Replies: 5
    Last Post: - 13th May 2011, 22:41
  4. PICs and Android
    By ardhuru in forum General
    Replies: 3
    Last Post: - 17th November 2010, 06:41
  5. Pulsin alternative
    By sbobowski in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th October 2008, 09:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts