 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > Wireless Communication | Forum Quick Jump
|
|  SAN Registered Member
        Date Joined Oct 2008 Total Posts : 22 | Posted 10/19/2009 7:19 PM (GMT -8) |   | Hi! I am making 2 autonomous robot,using Propeller Chip which needs to communicate with each other. Is it better to use Easy Bluetooth Module(#30085) for this purpose ? Is it possible to transfer data all the time using a new cog in propeller, even when other cogs are doing another tasks ? | | Back to Top | | |
 |  Mike Green Registered Member

       Date Joined Oct 2004 Total Posts : 13559 | Posted 10/19/2009 8:28 PM (GMT -8) |   | 1) Yes, the Easy Bluetooth Module would be a good way for the two robots to communicate as long as you remember the distance limitations (30m).
2) Yes, you can use a cog (probably 2) to completely manage communications using the Easy Bluetooth. You probably will need a 2nd cog to handle the low-level serial I/O and provide a buffered input routine (FullDuplexSerial). The communications management cog would communicate with the other cogs by using shared variables in the main (hub) memory. | | Back to Top | | |
 |  SAN Registered Member
        Date Joined Oct 2008 Total Posts : 22 | Posted 10/20/2009 3:44 AM (GMT -8) |   | Thank you very much sir. One more question... Is it possible to declare and use 2d array variable in Spin Language for Propeller chip ? - Like other computer language. | | Back to Top | | |
 |  StefanL38 Registered Member
        Date Joined Sep 2006 Total Posts : 958 | Posted 10/20/2009 5:19 AM (GMT -8) |   | You can define as many arrays as you want until the 32kB of RAM is filled up.
Analyse how big the values are that you want to store in the array-elements. you can define arrays of byte (values 0-255), word(-32767 to 32678 or long (-2.147.483.648 to 2.147.483.648)
arrays of word need two bytes per array-element arrays of long need four bytes per array-element
best regards
Stefan | | Back to Top | | |
 |  Mike Green Registered Member

       Date Joined Oct 2004 Total Posts : 13559 | Posted 10/20/2009 5:37 AM (GMT -8) |   | Your question was about 2D arrays.
Spin only supports 1D arrays. You can't declare 2D or higher order arrays.
Part of the reason for this is that there's limited memory available ... 32K bytes for the storage of a program and its data. It's expensive in terms of memory to store the amounts of data usually involved in 2D arrays. It's not hard to implement 2D arrays using 1D arrays and putting the subscript calculations explicitly like A[ i*5+j ] = B[ j*5+k ] + C[ i*5+k] for A[ i,j ] = B[ j,k ] + C[ i,k ] where A, B, and C are 5 x 5 arrays.
That said, I think one of the 3rd party Spin compilers (homespun) implements multiple dimension arrays.
There's also the Catalina C compiler and, if your programs are not that large, ImageCraft allows free use of their commercial C compiler for programs up to 16K in size. | | Back to Top | | |
 |  SAN Registered Member
        Date Joined Oct 2008 Total Posts : 22 | Posted 11/3/2009 2:35 AM (GMT -8) |   | Hello Sir, I have bought a pair of Parallax Easy Bluetooth Module (#30085). Now, I want to know how I can connect to bluetooth module for communication ? Is there any perticular object for that or the Serial obj, cna be used ? Plz help me. | | Back to Top | | |
 |  Mike Green Registered Member

       Date Joined Oct 2004 Total Posts : 13559 | Posted 11/3/2009 6:25 AM (GMT -8) |   | | Any of the serial objects can be used to communicate with the Easy Bluetooth module. I would recommend using the FullDuplexSerial object that comes with the Propeller Tool, mostly because it's buffered and can operate at high speeds if you want. The Easy Bluetooth module can operate directly off the +3.3V supply used by the Propeller and can be directly connected to any two I/O pins. I suggest using a series 2.2K resistor in the Tx lead of the Easy Bluetooth module to protect the Prop and Easy Bluetooth module in case you accidentally make the Prop pin an output opposite to the Easy Bluetooth module's signal polarity (one high and the other low). It's not necessary, but it would be prudent. | | Back to Top | | |
 |  SAN Registered Member
        Date Joined Oct 2008 Total Posts : 22 | Posted 11/3/2009 9:04 AM (GMT -8) |   | Than u sir. Now I can connect the module with my PC and its working fine with FullDuplexSerial object. But my ques is how i can connect two Easy Bluetooth Module ? Is there any command to Specify the MAC address of the bluetooth ? If u can give me a sample code. | | Back to Top | | |
 |  w8an Registered Member

       Date Joined Jul 2009 Total Posts : 47 | Posted 11/3/2009 8:40 PM (GMT -8) |   | | | |
 |  Mike Green Registered Member

       Date Joined Oct 2004 Total Posts : 13559 | Posted 11/3/2009 8:45 PM (GMT -8) |   | | You need to study the documentation, both for the Easy Bluetooth Module and the RBT-001 Bluetooth module that is part of it. All of that documentation and sample code is provided as links on the webpage that wBan mentioned. | | Back to Top | | |
 | Forum Information | Currently it is Saturday, November 21, 2009 11:43 AM (GMT -8) There are a total of 393,863 posts in 55,536 threads. In the last 3 days there were 84 new threads and 713 reply posts. View Active Threads
| | Who's Online | This forum has 17693 registered members. Please welcome our newest member, Fosco. 77 Guest(s), 10 Registered Member(s) are currently online. Details heater, Mike Green, Jim Fouch, JRetSapDoog, Dogg, hover1, Harley, Sapieha, Electronegativity, Tubular |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|