After you make the trasmitter and receiver, you should have something like this:
Transmitter:
Receiver (to put on the hovercraft) :
Okay, this should take you about 1 hour for the Transmitter and 1 hour for the Receiver.
Once you are done making it, make sure to setup your ACODE-300 modules to 115200 bps and they are connecting.
Before putting your ACODE-300 on your trasmitter and receiver, set them up using the software below and the ACODE Interface Board:
Insert your ACODE-300 module as shown
above to the interface board. Also connect a serial cable and
DC power (between 5 and 12V) to the interface board.
Run the PromiWIN4.0_Setup(En).exe installer program and install
Promi software, which we will use to link the two ACODE-300 wireless modules.
The default baud rate for ACODE-300 is set at 9600 bps. So Just
click OK, and you should be able to see the following screen:
Now we are ready to set the device to a faster baud rate.
Change the Operation Mode to MODE3, Baud rate to 115200bps and
set the device name to “device 1′ as shown above.
If you get the message “Configuration has been applied,” you are ready to go.
Unplug your ACODE-300 module from the interface board and plug it back into your trasmitter.
Power ON your study board and your ACODE-300 should start
blinking the LED like above every 1-2 seconds.
Now take your ACODE-300 module from your receiver and
plug it into the interface board and run Promi program again.
Once you are connected, change the Operation Mode to MODE1, Baud
rate to 115200bps and set the device name to “device 1′ as shown above.
After applying the above settings, Click on “Connection(out)” and press “Search”.
You should be able to find the “device 1′, the ACODE-300 module on the study board.
Now, select the “device 1′ and click on “Connect”.
You should see both LEDs of ACODE-300 turn on continusly once
you get this message:
(LEDs continuously ON)
When LEDs are lit up like above, the ACODE-300 modules are
connected and a straight RS232 serial connection has been
established. It’s as if a serial cable has been connected
wirelessly.
Now unplug the ACODE-300 module from the interface board and
plug it back into your receiver module:
Now when you power ON both trasmitter & receiver and you should see both LEDs light ON as shown in above picture.
Now open up your CUBLOC Studio and compile and download the transmitter program to the transmitter andthe receiver program to the receiver.
Now take your new party light to your friend's next party and start groovin!
Cool Pics of transmitter fitting in my hand:
Taking it Further...
Well, I've built a very simple protocol, actual here's the whole code for the transmitter:
Const Device = CB220
#define DEBOUNCE_RATE 10
Input 0
Input 1
On timer(DEBOUNCE_RATE) Gosub CheckKey 'Set at 200ms
Opencom 1,115200,3,10,10
Dim key0 As Byte, key1 As Byte
Do
Loop
CheckKey:
key0 = In(0)
key1 = In(1)
If key0=1 And key1=1 Then
Debug "Both Keys Pressed",Cr
Putstr 1, "B"
Elseif key0=1 Then
Debug "Right Key Pressed",Cr
Putstr 1, "R"
Elseif key1=1 Then
Debug "Left Key Pressed",Cr
Putstr 1, "L"
End If
Return
And the code for receiver:
Const Device = CB220
Output 14
Output 15
Dim Command As Byte
Dim Length As Byte
Opencom 1,115200,3,3,3
On Recv1 Gosub Get_Command
Out 14,0
Out 15,0
Do
Loop
Get_Command:
Length=Blen(1,0)
If Length>0 Then
Command=Get(1,1)
If Command=Asc("L") Then
Debug "Left Button Pressed",Cr
Out 14,1
Delay 200
End If
If Command=Asc("R") Then
Out 15,1
Delay 200
Debug "Right Button Pressed",Cr
End If
If Command=Asc("B") Then
Out 14,1
Out 15,1
Delay 200
Debug "Both Button Pressed",Cr
End If
End If
Out 14,0
Out 15,0
Return
Basically, all I did was to limit number of receive buffer and send buffer using Opencom() to prevent case of overflow and just use three letters, L, R, and B. L is for Left, R is for right, and B is for both buttons. You could probably see that you can build much more complex code on top of this.
Here's schematic of I/O Cell Relay and ACODE Data spec sheet for reference:
I am thinking of a hover-bot next...I think I can just put some sensors and make it roam around on it's own now, no more controlling it, got to give it freedom to think on its own... :)
Happy Holloween!
<:)
If you are having any trouble with above app, please e-mail max@zedomax.com
If you have any cool apps you'd like to share or want some kind of DIY, please e-mail to max@zedomax.com
We do accept free samples for DIYs, please email max@zedomax.com :)