Shop OBEX P1 Docs P2 Docs Learn Events
Android android - Linking a mobile phone and Propeller. - Page 4 — Parallax Forums

Android android - Linking a mobile phone and Propeller.

124

Comments

  • Heater.Heater. Posts: 21,230
    edited 2010-09-26 16:22
    DonEduarno,

    That is very good to hear. I have Amarino installed on my phone already. As I now have a Prop ASC board (Arduino Shield Compatible) I think I'll splash out on Bluetooth shield for it. The $1 Bluetooth modules I picked up are just too small to work with.
  • DonEduardoDonEduardo Posts: 54
    edited 2010-09-26 18:05
    The bluetooth modules I linked to are probably about the same size. What I did was take some 26 (maybe 28) gauge wire and tinned the ends with solder. Then I put flux on it and on those little semicircles on the outside of the board. I put the board on its side, and put the wire in the semicircle (all held in place with those helping hands type clips). Then I just touched a very hot iron onto the wires. Its held up pretty good so far. I might put some hot glue on them when I'm done to minimize movement.
  • M. K. BorriM. K. Borri Posts: 279
    edited 2010-10-07 21:30
    Does anyone still want the source code for this?
  • simonlsimonl Posts: 866
    edited 2010-10-08 01:31
    Source code is always welcme :-)

    BTW: Does anyone know if the serial port if available on the Samsung Galaxy S or the HTC Desire?
  • hinvhinv Posts: 1,252
    edited 2010-10-08 07:31
    Heater. wrote: »
    Wow. A couple of thousand pages of spec!

    Good grief, all I want is a serial link from Prop to Phone.

    The USB Host solution for the Prop is great and I intend to try it out. But it eats cogs.

    Cogs here are onle $1 each when you buy them 8 at a time ;^)
  • siljamickesiljamicke Posts: 66
    edited 2011-02-08 11:14
    Bump! Need to hear more!
    Is there no device that could be host and let two devices sorta think the other device is a host, like an adapter... As you notice I haven't got the slightest idea of how usb works, but if one prop could be the middle hand, then the setup would only be twice as expensive as opposed to ten times or whatever the "bluetooth->wifi->goingroundtheworld->pop3_mail_on_prop"-scheme would imply...
  • jhr0771jhr0771 Posts: 1
    edited 2011-03-25 11:53
    I found cellbots.com and I liked the idea of connecting a G1 to the bot, so I went to the store and got the first one I could find ( I was not interested in the robot itself but working in the connection with the cell phone ). I ended up getting the sumobots kit( 2 robots for 200, sounded nice :-) ). Has any one being able to connect an android phone to a STAMP Basic robot ?
  • laser-vectorlaser-vector Posts: 118
    edited 2011-03-25 21:15
    I'm not sure if this has been mentioned yet but one could write a web interface on the prop and connect to it via wifi (that way all devices like iPhone android and pc could connect). Then either control it via a web page or write applications in android sdk that just send and receive data/control packets.
    Just an idea..
    But I can't wait for this!! I just got a xoom and love it
  • Heater.Heater. Posts: 21,230
    edited 2011-03-26 00:21
    laser-vector,

    Yes indeed. Could you outline all the components, hardware and software, required to pull that off?

    All I ever wanted was the equivalent of a simple serial line from Prop to Android with equally simple software to use it with.

    Looks like the closest we have come so far is M.K.Borri's USB host and Android Debug Bridge. Which I intend checking out ASAP.

    http://forums.parallax.com/showthread.php?130380-Android-Debug-Bridge-on-a-prop
  • M. K. BorriM. K. Borri Posts: 279
    edited 2011-03-26 02:06
    Heater, check the updated object -- it lets you use either a telnet socket for serial, or a shell connection.
  • MacTuxLinMacTuxLin Posts: 821
    edited 2011-03-26 10:21
    Just one word ... Wow ...
  • M. K. BorriM. K. Borri Posts: 279
    edited 2011-03-26 16:40
    I now sell a kit that couples this with the Serial Router to give 8 serial ports to your phone if anyone cares (I won't post the schematic because it's obvious, just a prop and some max232s, anyone can figure that out :)
  • JonagpaJonagpa Posts: 7
    edited 2011-09-05 14:29
    Hello all, I require your assistance.

    I want to make a motorcycle gauge using a android tablet.

    There are several lights like oil pressure, water temp and neutral light also some gauges like fuel, speed and rpm.

    The light indicators works at 12vdc. the rpm gauge works at ~12vdc, the higher rpm the lower the voltage. Fuel sensor I have to figure out but I think it works at 12v at full (sensor raises resistance as fuel lowers). Speed sensor I have no idea yet, it uses a magnet and sensor to count the revolutions of the wheel. I think I can get/tab into all this info at the stock gauge connector/plug. I am not looking to contol anything, just dispay data on an android screen.

    I understand I need some kind of microcontriller or interface unit to pass this info to android or process this info, translate it into usable data and pass it on to android to be displayed. The problem is that I have basic understanding of electronics and some light programing experience. I need to be thrown in the right direction. What I do have is persistence and motivation.

    My question is what hardware do I need to make this happened. I was looking at arduino or some pbasic stamps but like I said before I have no clue where to go from here.

    Since I have some light programing experience a easy language would be preferred. Price is another issue, I was looking to spend as little as possible in other words what ever it takes to run/do what I want and nothing more. Please help the choose the best board with the easiest language at a good price :)

    Your guidance would be much appreciated, thank you.
  • JonagpaJonagpa Posts: 7
    edited 2011-09-06 18:52
    so? it is relevant in both threads, whats the big deal? just trying to get help. Thanks.
  • LeonLeon Posts: 7,620
    edited 2011-09-07 03:18
    Duplicating posts like that isn't allowed on this forum.
  • JonagpaJonagpa Posts: 7
    edited 2011-09-07 17:51
    ok sorry thanks
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-09-08 07:43
    I now sell a kit that couples this with the Serial Router to give 8 serial ports to your phone if anyone cares (I won't post the schematic because it's obvious, just a prop and some max232s, anyone can figure that out :)

    Could you put a direct link to your kit in your signature? I saw your working in another thread, but the search function on the forum is not as braino friendly as it might be and I'm not finding it. I've just been notified that my iPhone 1 Smart-Only-In-Name-Phone is being updated to a Samsung Galaxy

    I found your wiki from post 81 but I can't find a link to the the thing we can buy. In fact, after drilling down several layers, I seem to be finding all the intermediate pages and ending at all the pages that are not present. Could you include a direct to the final item(s)?

    Also, don't assume anything is obvious, I'm software guy, and this hardware stuff is all magic smoke and mirrors to me! :)

    @Heater, can you confirm that this is the path you are pursuing? Did it work for you as easily as it did for the NASA folks?
  • Heater.Heater. Posts: 21,230
    edited 2011-09-08 07:57
    Braino,
    It looks like M.K.Borri has the answer to my dreams as expressed when I started this thread. A link from Prop to Android phone with only a simple cable. No expensive and clunky bluetooth or wifi dongles.
    Sadly apart from splashing out on a Gallaxy S I have not managed to find the time to purse this development. Still hoping to though.
    P.S. I find that an advanced Google search pointed at forums.parallax.com always works better than the forum search.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-09-08 20:05
    Wow. Endless possibilities!

    Schematic here http://robots-everywhere.com/re_wiki/index.php?title=PropBridge

    Program the Android using Basic here http://www.basic4ppc.com/forum/ (or use Java if you prefer).

    I think the prop can turn the android on and off which will be great for powering it down and saving power.

    The Android can be the GUI/display for the prop. The prop can do all the clever I/O things.

    How does the 5V work? Is there 5V coming 'out' of the android's USB, in which case one wouldn't want to connect 5V onto that schematic?
  • TubularTubular Posts: 4,620
    edited 2011-09-08 20:15
    Heater, we're just waiting for you to declare it "impossible" :)

    Seriously though, we really need to find some time and make a short tutorial.

    A few weeks ago little bird ran a full day course for getting the Sparkfun IOIO to do the same thing - turn a led on or off, or get an analog input in (from a pot / temp sensor) and display it on the droid screen. What was really interesting is just how many ways there are to fail along the way (software install, usb drivers, then onto the droid side). There were 20 smart people in that room using all different OS's, and it took a lot of smart people hours to get *most* up to the stage of blinking a led. Of course once its running, its all easy.
  • JonagpaJonagpa Posts: 7
    edited 2011-09-08 21:18
    Yes a tutorial would be great, especially if you include a parts list and how to actually make the board because I have no idea.
    Btw I am thinking about buying that ioio board, sitting in the shopping cart right now with a bunch of other stuff but I am still hoping for this.
  • Heater.Heater. Posts: 21,230
    edited 2011-09-08 21:34
    Dr A,
    The usual USB port on Android machines, like my Samsung Galaxy phone, is USB "device" port. In the same way that a USB serial adapter is a "device" plugged into your PC which is the "host". A USB memory stick or mouse or keyboard etc are all examples of USB "devices".
    As such the Android machine can take power from the host, as when charging the battery from USB. It does not provide power, only hosts do that.
    In our case the Propeller is the host rather than your PC. Potentially the Propeller end of the link could be designed to also power the phone.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-09-08 22:07
    Ok, so here is the software challenge. On the propeller, some sort of sensor (eg a LDR) and display that on the android. And for output, a light or a servo on the prop that you can control on the android with a slider or something.

    If you can sense things and control things, that opens up lots of possibilities.

    On another topic, I can program my android pad from basic4android using wifi. Wifi also enables connection to the internet. This means the propeller ought to be able to access the net. Your robot can be internet aware. That means it can run over to the window and charge up its batteries when it reads on the weather website that the day will be sunny.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-09-08 23:16
    Samsung Galaxy S II or Motorola Droid Bionic? Or which ever is cheaper?

    I was thinking the Bionic is similar, and now that Moto is pwned by google, it might have some advantages?
  • Heater.Heater. Posts: 21,230
    edited 2011-09-09 01:17
    Dr A,
    Exactly. Good challenge. I suspect M.K.Borri has something like that in his thread somewhere.

    Braino,
    I cannot advise as to which might be the Android phone for anyone. Anyway my intention when starting this thread was not to use an expensive smart phone but to dedicate some cheap Android phone/tab to such Propeller projects. As I predicted at the start there is a now an ocean of cheap Android devices around.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-09-09 07:54
    Writing a program on a cheapie android pandapad/epad/apad/android tablet.

    1) Get Basic4Android (I paid a small amount for this software and it is well worth it. I think you can test it for free.)

    2) Connect your android to your home wifi network.

    3) Find your android's IP address. Click the Wifi settings button, then click the name of your home network (mine is called "Moxham" so I clicked that and it came up with my IP address. Note the number.

    4) Tell adb.exe what the address is. Browse using cmd to the directory below and run the program adb with the command "connect" and the IP address
    C:\Program Files\Android\android-sdk-windows\platform-tools>adb connect 192.168.2.2
    connected to 192.168.2.2:5555
    C:\Program Files\Android\android-sdk-windows\platform-tools>
    

    5) Run Basic4Android and enter the following program. Most of this is already filled in so you only need to add this little bit of code:
    Sub Activity_Create(FirstTime As Boolean)
        Log("Hello world!")
        Msgbox("Hello world", "First program")
    End Sub
    

    And click the "Run" button and it will download and run.

    I am downloading wirelessly, which I must say is pretty darn clever. You can also download via a cat5 cable.

    What I am not sure about is talking to the device via USB. I never got this working because I was waiting for ages for a USB cable to arrive on ebay and then found out about wireless downloads. But I think for talking to a propeller you are going to need USB.

    I'm not entirely sure what the USB connection is on my android, as I have a feeling that it works as a USB host, ie you can plug a memory stick or a mouse into the USB slot and it is powered by the android. But I think we want the propeller to be the host so I don't quite know how the 5V is going to work out, or even if the USB Tx and Rx wires need to be swapped.

    6) Write a more sophisticated program. This was the best I got working for output - 'play' a serial output via RS232 out of the speakers. Probably obsolete with this new propeller host, but it does give an example of how to write real code on an android.
    'Activity module
    Sub Process_Globals
    	'These global variables will be declared once when the application starts.
    	'These variables can be accessed from all modules.
        Dim MediaPlayer1 As MediaPlayer
    End Sub
    
    Sub Globals
    	'These global variables will be redeclared each time the activity is created.
    	'These variables can only be accessed from this module.
    	Dim AudioFile(88200) As Byte ' one second of sound
    	Dim AudioFileCounter As Long
    	Dim BytePacket(13) As Byte
    End Sub
    
    Sub Activity_Create(FirstTime As Boolean)
    ' see C:\Program Files\Android\android-sdk-windows\platform-tools 
    ' run the small batch file adb connect 192.168.2.6 where the IP address is the device address
    ' to get the IP address, Wifi settings, 3rd one down just under WiFi networks is the name of the network connected to
    ' Click this and it gives the signal strength and also the IP address
    	Dim i As Int 
    	Dim j As Int 
    	Dim strings As String 
        'Msgbox("Play a wav file", "First program")
    	'MediaPlayer1.Initialize( )
        'MediaPlayer1.Load("/sdcard", "1200.wav")
    	CreateWavHeader ' create the header 
    	addbytetowav(32)  ' space
    	addbytetowav(13) ' carriage return
    	addbytetowav(10) ' linefeed
    	addbytetowav(72)  ' H
    	addbytetowav(101) ' e	
    	addbytetowav(108) ' l
    	addbytetowav(108) ' l	
    	addbytetowav(111) ' 0
    	addbytetowav(32) '  space	
    	addbytetowav(87) '  W
    	addbytetowav(111) ' o
    	addbytetowav(114) ' r
    	addbytetowav(108) ' l	
    	addbytetowav(100) ' d
    	addbytetowav(13) ' CR
    	addbytetowav(10) ' LF
    	'For i=33 To 126
        '  addbytetowav(i) ' add ascii characters
    	'Next
    	CreateWavFooter
    	savewavfile
    	playcreatedwav
    	activity.finish ' close the program
    End Sub
    
    Sub Activity_Resume
    
    End Sub
    
    Sub Activity_Pause (UserClosed As Boolean)
    
    End Sub
    Sub SaveWavFile
        Dim raf As RandomAccessFile ' see bottom corner of this program "Libraries" tab and check RandomAccessFile
    	Msgbox("Saving to sd card","")
    	raf.Initialize(File.DirDefaultExternal, "packet.wav", False)' open the file which will end up in I:\Android\data\test.test.test\files (test.test.test is my program)
    	raf.WriteBytes(audiofile,0,88199, 0) ' write bytes. Is 32768 the max size as this is an integer variable
    	raf.close
    End Sub
    Sub PlayCreatedWav
    	MediaPlayer1.Initialize( )
        MediaPlayer1.Load(File.DirDefaultExternal , "packet.wav")
    End Sub
    
    Sub CreateWavHeader
    	Dim i As Int 
        audiofile(0)=0x52 ' R
    	audiofile(1)=0x49 ' I
    	audiofile(2)=0x46 ' F
    	audiofile(3)=0x46 ' F
    	audiofile(4)=0x34 
    	audiofile(5)=0xB1
    	audiofile(6)=0x02 
    	audiofile(7)=0x00 
    	audiofile(8)=0x57 
    	audiofile(9)=0x41 
    	audiofile(10)=0x56 
    	audiofile(11)=0x45 
    	audiofile(12)=0x66 
    	audiofile(13)=0x6D 
    	audiofile(14)=0x74 
    	audiofile(15)=0x20 
    	
    	audiofile(16)=0x10 
    	audiofile(17)=0x00 
    	audiofile(18)=0x00 
        audiofile(19)=0x00 
    	audiofile(20)=0x01 
    	audiofile(21)=0x00 
    	audiofile(22)=0x01 
    	audiofile(23)=0x00 
    	audiofile(24)=0x44 
    	audiofile(25)=0xAC 
    	audiofile(26)=0x00 
    	audiofile(27)=0x00 
    	audiofile(28)=0x88 
    	audiofile(29)=0x58 
    	audiofile(30)=0x01 
    	audiofile(31)=0x00 
    	
    	audiofile(32)=0x02 
    	audiofile(33)=0x00 
    	audiofile(34)=0x10 
        audiofile(35)=0x00 
    	audiofile(36)=0x64 
    	audiofile(37)=0x61 
    	audiofile(38)=0x74 
    	audiofile(39)=0x61 
    	audiofile(40)=0x5C ' size in bytes (same as size of array = 88200 = 0x15888 minus the 44 bytes at the beginning 1585C)
    	audiofile(41)=0x58 
    	audiofile(42)=0x01 
    	audiofile(43)=0x00 
    	' data starts at 44
    	For i=44 To 99
    	  audiofile(i)=0 ' some zero values at the beginning of the file
    	Next
    
    	audiofilecounter=100' start of data
    
    End Sub
    
    Sub CreateWavFooter
       ' fill with zero (RS232 ends on 7FFF which is negative. So need to bring bias back to zero
       Dim i As Int
       For i=audiofilecounter To 88199
         audiofile(i)=0 ' change to zero
       Next
    End Sub
    
    Sub FillBytePacket
    	Dim i As Int
    	For i=0 To 13
    		bytepacket(i)=65+i ' dummy values starting at A
    	Next
    End Sub
    
    Sub AddByteToWav(ByteValue As Int) ' uses audiofilecounter
     ' wav file format is 0 for silence. values from -7FFF to 8000. LSB first. So FFFF is -1 which is just less than 0 for silence
     ' data starts at byte 43 https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
     ' so on hexedit, header is first two lines and 12 bytes of the third line
     ' the previous 4 bytes are the size of the data NumSamples * NumChannels * BitsPerSample/8
     ' this is a 1 channel sample.
     ' bytes 34 and 35 are the bits per sample = 0x0010 which is 16
     ' so size is numsamples * 1 * 16/ 8 which is numsamples *2
     ' the number of samples I have for 1 second of 1200 baud is 0x015876 which is 88182 or 44091 x 2.
     ' for a 1200 baud square wave this is high for 1/2400th of a second and low for 1/2400th second
     ' sample rate is 44100 per second. 
     ' ** addit - all the above is WRONG and it turns out this is a 2400 baud output ***
     ' for a 4410hz tone this will be high for 5 samples and low for 5 samples
     ' 1200 is 36.75 samples. 18.375 high and 18.375 low.
     ' BUT - 1200 baud means 1200 bits per second. So a character U will be 18.375 low then 18.375 high etc
     ' the start bit is 18.375 samples. 
     ' There are some aliasing issues here as well due to the remainder. This is 147/8
     ' so need to round to the nearest integer
     ' 18.375 =  18
     ' 36.75 =   37
     ' 55.125 =  55
     ' 73.5 =    74
     ' 91.875 =  91
     ' 110.25 =  110
     ' 128.625 = 129
     ' 147 =     147 
     ' 165.375 = 165
     ' 183.75 =  184
     ' 202.125 = 202
     ' 220.5 =   221 rounded up as this is the idle bit then start at zero again
     ' then restart on whole integer values 
     ' RS232 idle is -12V. Logical 1 is -12V. Logical 0 is +12V. Start bit is +12V. Stop bit is -12V
     ' translate this to 0/5 "true" logic levels where resting is 0V and the bits are inverted
     ' resting is 0V. Start bit is 5V. High is 0V. Low is 5V. Stop bit is 0V
     ' or "space", mark or space x8, "mark"
     ' "mark" is 7FFF, "space" Is 8000
     ' so there is the start bit, 8 data bits, stop bit and an idle bit making 11 bits.
     ' set up a counter and start at 0
     ' 0-17 = start bit 
     ' 18-36 =  bit 0
     ' 37-54 =  bit 1
     ' 55-73 =  bit 2
     ' 74-90 =  bit 3
     ' 91-109 = bit 4
     ' 110-128= bit 5
     ' 129-146= bit 6
     ' 147-164= bit 7
     ' 165-183= stop bit
     ' 184-202= idle
    
     Dim i As Long
     Dim testvalue As Int
     Dim msb As Byte
     Dim lsb As Byte
     msb=0x80
     lsb=0x00
     For i=0 To 17 ' start bit
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
     testvalue=Bit.And(bytevalue,0x01)' test bit 0
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 = space
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF = mark
    	 lsb=0xFF
     End If
     For i=18 To 36
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
      testvalue=Bit.And(bytevalue,0x02)' test bit 1
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF
    	 lsb=0xFF
     End If
     For i=37 To 54
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
      testvalue=Bit.And(bytevalue,0x04)' test bit 2
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF
    	 lsb=0xFF
     End If
     For i=55 To 73
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
      testvalue=Bit.And(bytevalue,0x08)' test bit 3
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF
    	 lsb=0xFF
     End If
     For i=74 To 90
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
      testvalue=Bit.And(bytevalue,0x10)' test bit 4
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF
    	 lsb=0xFF
     End If
     For i=91 To 109
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
      testvalue=Bit.And(bytevalue,0x20)' test bit 5
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF
    	 lsb=0xFF
     End If
     For i=110 To 128
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
      testvalue=Bit.And(bytevalue,0x40)' test bit 6
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF
    	 lsb=0xFF
     End If
     For i=129 To 146
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
      testvalue=Bit.And(bytevalue,0x80)' test bit 7
     If testvalue=0 Then 
         msb=0x80 ' hex 8000 
    	 lsb=0x00
       Else
         msb=0x7F ' hex 7FFF
    	 lsb=0xFF
     End If
     For i=147 To 164
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
     ' stop bit = "mark"
     msb=0x7F 
     lsb=0xFF
     For i=165 To 183
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
     ' idle bit = mark and leave in this state
     msb=0x7F 
     lsb=0xFF
     For i=184 To 202 ' time to resynch
          audiofile(audiofilecounter)=lsb ' LSB
          audiofilecounter=audiofilecounter+1
          audiofile(audiofilecounter)=msb ' MSB
    	  audiofilecounter=audiofilecounter+1
     Next
    End Sub
    
    1024 x 768 - 56K
    1024 x 768 - 93K
    1024 x 768 - 68K
    1018 x 734 - 114K
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-09-09 11:14
    Heater. wrote: »
    I cannot advise as to which might be the Android phone for anyone. ....cheap Android devices around.

    Just want to know which one YOU were looking at. In my case, I can only get one, and I have to be able to use it as a phone for several years, so it make more sense to spend extra to get one that will not become obsolete quite as fast. Even though my stride is not long enough to follow in the footsteps of greatness, I at least want to see the path they are taking.
  • Heater.Heater. Posts: 21,230
    edited 2011-09-09 11:57
    Braino,
    Everything will go obsolete or out of fashion very fast in todays world. No way around that.
    But there is another way. Get the cheapest dumbest phone you can find. Android or not, as long as it costs no more than a couple of beers and works as a phone who cares?
    Next find a nice cheap Android phone/tab that you can dedicate to your Android/Propeller project(s).
    Bingo, both requirements fullfilled.
    Now, if you need a flashy phone to impress you work mates and friends then you are into another whole world of pain.
    Your priorities are for you to set.
    As for me, I'm just watching things flow by until something is shiney enough and cheap enough that I want to grab it:)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-09-09 17:33
    Some notes here on connecting to the android by one of three methods:
    cat5
    wifi
    USB

    http://www.basic4ppc.com/forum/basic4android-getting-started-tutorials/6484-connecting-your-device-ide.html

    For programming the android wifi may be the most convenient.

    But for interfacing with the propeller, I am guessing that only USB is the practical alternative.

    I am not sure how the android responds if both the prop and the PC are trying to talk to its debug bridge at the same time. In practice, I imagine the first step is to build a fairly simple interface between the prop and the android - possibly along the lines of a two directional link with circular buffers at both ends and 'head' and 'tail' pointers. So each device can dump out some data to the other and not have to worry about it after that. So the android might send out 10 bytes which are settings for servos that the propeller is controlling.

    Then once that works, get on with writing the high level code on the PC for the android.

    I am guessing that you need a male to male USB cable to connect a PC to an android in debug mode?

    I haven't tested this though, and post #4 on that thread above suggests that it may not be possible to talk via USB to an apad/pandapad. In which case if you can't get a PC to talk, maybe the prop can't either?
Sign In or Register to comment.