DrAcula and "control real world devices"

deneve

New Member
Dr Acula has a really great introduction to controlling devices in an instructibles article http://www.instructables.com/id/Control-real-world-devices-with-your-PC/
and I am working through this. I want to do the same thing but use liberty basic rather than visual basic at the pc end. Liberty basic has a standard port control command:

open "com1:9600,n,8,1,ds0,cs0,rs" for random as #com.

to write to the port, the manual says just use

print #com "hello world"

This is fine for strings but the serin command for the receiving picaxe would be something like

serin 3,("data"),b0

So here is my query. How can I send the b0 part? DrAcula uses a byte declared variable and , I think, turns d,a,t,a, into asci numbers, attaching them to the b0 byte before sending. This does not seem available in liberty basic. I'm not sure how to begin here - I don't quite know how the picaxe interprets what's coming in.

Any advice would be gratefully received.

deneve
 

kenjanzen

New Member
I have used “Liberty Basic” to communicate with a “Picaxe” using serial output through Bluetooth with no problem.

The open command I used in Liberty Basic was:
open "com41:2400,n,8,1," for random as #comm

The serial out command I used in Liberty Basic was:
print #comm, "k" + chr$(speed) + chr$(lite)

The serial in command I used for the picaxe was:
SERIN 4,T2400,("k"),mt_sp,swt_p

I was sending numerous commands from the computer and so I sent the qualifier “k” first, followed by the two bytes of data as “speed” and “lite”.

The picaxe waited for the qualifier “k” and then receives the next two bytes of data and stored it as “mt_sp” and “swt_p”.

I would suggest for Liberty Basic trying:
open "com1:2400,n,8,1," for random as #com
print #com, chr$(b0)

And for the picaxe:
serin 3,T2400,b0

Note: 9600 speed is not available if you are running the picaxe at 4MHz.
 

tarzan

Senior Member
JustBasic 4x4ROV Controller

Don’t ask me why I did it or if it’s correct because I can’t remember.

This is a copy of my 4x4ROV GUI in JustBasic, which was originally done in VBA.
I remember that there was an issue with receiving the text strings into the textbox. Had to set a timer in the [main.inputLoop], there is probably a better way than that. This caused problems displaying complete text strings without breaks as they were received; no end of string marker was used.

(1.17 MB)

P.S. This will open com2, if it’s already in use it won’t open.
 

Attachments

Last edited:

deneve

New Member
Thank you kenjanzen. This worked perfectly so now I have control of picaxe via my PC. BTW I really like LB it's so straightforward compared to VB.net and yet you can build forms and widows just as well.

Your Help was much appreciated thank you again.
deneve
 

deneve

New Member
Thanks Tarzan. Have downloaded your JB zip which looks really useful. I will study it carefully.

deneve
 

moxhamj

New Member
Once you get it working, maybe post it all on the forum or on a website or instructable. Part of the reason I publish things like this instructable is so I can go back and reference it myself later. These alternative Basic languages are really starting to give M$ a run for their money. Probably why .Net is now given away for free...
 
Top