Quick and simple PC basic program

moxhamj

New Member
I've just come across a nifty little Basic program that can run on a PC and looks like picaxe basic.

Ok, my experience of Basic started with Mbasic and then Qbasic and then vb and then vb.net. Each one got bigger and more complicated and was harder to get to "Hello World"

vb.net is somewhat easy to use, but it does need about 100mb of software downloaded, it won't install on some machines and any executable takes up to 20 seconds to load.

http://www.robotbasic.org/2.html

Download the help and the exe which combined are about 2.5mb. Put them in a new folder. Run the program RobotBasic.exe

No installation needed. No .dlls or other complications. It should run instantly.

Type in a program:
Code:
' Type your new program here or use 
' the menu to load an existing one
print  "Hello"
input "new value",a
print "Value is";a
input "Press Enter to finish",a
Save it. 162 bytes. (not Kilo or Mega bytes). Run it. Runs instantly. There wasn't even a syntax error.

Now compile it. (File/Create EXE) Takes about 0.1 seconds and produces a totally standalone .exe

This came up on the Propeller forum (can I say that?) as a way of writing a very simple program to interface to a propeller to store data to an excel comma seperated file http://forums.parallax.com/forums/?f=25&m=391115&g=391123#m391123. This is something that is entirely relevant to Picaxe too, and indeed I've written something very similar in vb.net and posted it on Instructables. But vb.net is sooo slooow, and I still can't get it to install on one of my xp machines.

How often do you need a quick and simple program that can talk to a picaxe, grab some variables and put them in a file?

It can do complicated coding too - check out the programs at http://www.robotbasic.org/index.html

Hmm, methinks we need a simple demo to talk to a picaxe...
 
Last edited:

MartinM57

Moderator
Looks very interesting - good find :)

Who's doing the demo then (PICAXE and RB code required!)?

Unfortunately my day job is stopping me from having a go this afternoon...:(
 

Dippy

Moderator
DrAc can do it.
He spends more time PICAXEing than talking to his patients so they are probably quite used to sitting for hours in the Waiting Room polishing their verrucas :)
 

hippy

Technical Support
Staff member
Looks interesting. A bit 'clunky' on the run-time visuals but you get what you pay for.

To prevent the license popping up on every start, assuming launched from a desktop link ...

Create an empty C:\wherever\blank.bas file
Make that read only, via Explorer, or ATTRIB +R C:\wherever\blank.bas
Change the desktop link and add C:\wherever\blank.bas to end of the Target

Compiled .EXE files seem to be the entire RobotBASIC.Exe appended with a 'binary save' of the source so a bit large, 1.5MB.
 

MFB

Senior Member
Good find but what do you think of Liberty Basic?

If you need a quick VB macro for importing PICAXE serial data to Excel, try downloading SelmaDAQ from www.selmaware.com.
 

MartinM57

Moderator
A good set of exemplar robo/liberty Basic and PICAXE programs would be:
- the PICAXE doing something useful all the time e.g incrementing a count on an LCD, say 5 times a second
- being able to press a key/screen button on the PC, at any time, and send a command from BASIC to the PICAXE to reset the count to zero
- being able to press a button connected to the PICAXE, at any time, that sends the current count to the BASIC so that it displays it on the PC screen

..on PICAXEs with:
- no timeout on serin
- timeout on serin
- background serin

All other common PC<->PICAXE comms requirements are just variations/simplifications on that set of functionality.

Simples ;)
 
Last edited:
MFB

Many thanks for the link to www.selmaware.com (now supported at www.parallax.com/tabid/393/Default.aspx) - I've been looking for a means of directly importing data from a PICAXE into EXCEL without having to first capture it using Hyperlink and before importing it. It becomes tedious after a while!

I had a simple PICAXE program running within a few minutes of downloading the software - I just studied one of the program examples to work out the necessary PICAXE commands.
 

rbright

Member
RobotBasic Primer on TCP &amp; UDP with examples

Before the weekend I started exploring the capability of RobotBasic wanting to compare it to Liberty Basic that I've programmed with for a while.
Robotbasic with just 2 instructions in a dozen lines of code had me sending emails through my usual ISP mail server - just by loading one array with the address & account codes and another array with the message to be sent. Instruction "data" loads arrays then use the instruction "sendemail" spits it out on the net.
I've seen no way of doing this in LB except by using the downloadable sendemail.exe program but that is cheating.

Follow this link to a good basic description on using TCP and the more basic UDP protocols and how this works in a overall network.
http://www.robotbasic.org/resources/RobotBASIC_Networking.pdf

RobotBasic has excellent graphic ability like Liberty Basic and can be used to produce a nice GUI if you have the time with a lot of hand coding whereas add-ins to LB can click and drop buttons, textboxes etc ala Visual Basic.

One thing RobotBasic has inbuilt is a set of instructions to directly control the USBmicro USB I/O boards that you can pick up for $40. Bit off topic I know on a picaxe forum but the USBmicro is a nice bit of kit although it can't run inbuilt code.

Be nice to see a pixaxe.dll to run in RobotBasic one day

Cheers
 

julianE

Senior Member
Before the weekend I started exploring the capability of RobotBasic wanting to compare it to Liberty Basic that I've programmed with for a while.
Robotbasic with just 2 instructions in a dozen lines of code had me sending emails through my usual ISP mail server - just by loading one array with the address & account codes and another array with the message to be sent. Instruction "data" loads arrays then use the instruction "sendemail" spits it out on the net.
I've seen no way of doing this in LB except by using the downloadable sendemail.exe program but that is cheating.

Follow this link to a good basic description on using TCP and the more basic UDP protocols and how this works in a overall network.
http://www.robotbasic.org/resources/RobotBASIC_Networking.pdf

RobotBasic has excellent graphic ability like Liberty Basic and can be used to produce a nice GUI if you have the time with a lot of hand coding whereas add-ins to LB can click and drop buttons, textboxes etc ala Visual Basic.

One thing RobotBasic has inbuilt is a set of instructions to directly control the USBmicro USB I/O boards that you can pick up for $40. Bit off topic I know on a picaxe forum but the USBmicro is a nice bit of kit although it can't run inbuilt code.

Be nice to see a pixaxe.dll to run in RobotBasic one day

Cheers
I've tried using robotbasic to send emails but could not get it to work, I was hoping to use my gmail or a yahoo account. Would it be possible to post a sample robotbasic program that would work with common email providers.

thanks.
 

Hugh McCormack

New Member
I've tried using robotbasic to send emails but could not get it to work, I was hoping to use my gmail or a yahoo account. Would it be possible to post a sample robotbasic program that would work with common email providers.

thanks.
Is it because of software such as this that I, and many others, get bombarded with spam on an ongoing annoying basis? If so, then please don't post the code.
 

Pauldesign

Senior Member
Is it because of software such as this that I, and many others, get bombarded with spam on an ongoing annoying basis? If so, then please don't post the code.
In my opinion, Freeware or free something is to help the needy (esp the enthusiasts and DIY with little or no money) and like any other payable item, can also be mis-used for any other wrong reasons and that is why you've all the measures to avoid such things.

Good and payable things can and are being use on a daily basis for bad purposes (the list is broad and endless) and vice versa.

Just bear in mind; good products are bad products, it all depends on the end user use.

What Julian is requesting is what any other person willing to learn would have done the same and there is nothing wrong in that.

If you're too scared, it's up to to ensure u protect yourself.

Nothing personal Hugh, just my thought as a young enthusiast willing to know and use any educational info esp freebies. ;)
 

hippy

Technical Support
Staff member
I've tried using robotbasic to send emails but could not get it to work, I was hoping to use my gmail or a yahoo account. Would it be possible to post a sample robotbasic program that would work with common email providers.
It may be sensible to join the RobotBASIC forum as there are probably more people there who can answer such queries than here ...

http://www.robotbasic.org/9.html
 

julianE

Senior Member
It may be sensible to join the RobotBASIC forum as there are probably more people there who can answer such queries than here ...

http://www.robotbasic.org/9.html
I'm sorry if I asked an inappropriate question. Please disregard it and no need to post any code samples. I was just trying out the robotbasic because it is so easy to interface to Picaxe. Late last night I stumbled onto a utility for sending emails, it's a command line interface but that's not too hard to use with a shell command, took a while to figure it out but I have it working. My idea is to have a picaxe send an email when a parameter it was monitoring reaches a certain level. I'm very much a beginner and have found this forum extremely helpful, hence why I asked a question here instead on robotbasic forum, of course, Hippy is right, I should have posted it on the their forum.

I will be more mindful in the future.
 

hippy

Technical Support
Staff member
No, it wasn't an inapproriate posting, just trying to be helpful. I looked at the networking.pdf and it was beyond me, so thought you might get better joy over yonder.

All PICAXE related stuff is welcome, so when you do get it working, please do let everyone know !
 

julianE

Senior Member
Thanks Hippy, I heeded your advice and went to the RobotBasic forum. Turns out the SMTP on robotbasic will only work on port 25 which my internet provider blocks. The work around I settled on is to use the SPAWN command, an equivalent of the SHELL command. I found a PERL utility on the web that will send emails by placing all the information on the command line. I used a Gmail account since Yahoo requires premium email for SMTP to work. The port used is 587.

the command in RobotBasic looks something like this.

SPAWN ("c:\robotbasic\sendEmail.exe","-f FromEmail@gmail.com -t ToEmail@yahoo.com -s smtp.gmail.com:587 -xu UserId@gmail.com -xp EmailPassword -u ""Email Title"" -m ""Email Mesage.""",P_WAIT)

It's very kludgy calling an external program but it works.

In my program I have the Email particulars in a variable that can be modified by the program so as to be able to change the Email message.

Thanks for all the help, I am more familiar with Visual Basic but I wanted to give RobotBasic a whirl.
 
Top