Picaxe, Serial, Special f/x help.

ericthemannn

New Member
This is going to be for a haunted house that I am planning to build, with audio animatronics and lighting/audio f/x. I want to have a picaxe talk to a pc via serial. When an input trigger is activated, a pir in this case, I want the picaxe to tell the computer to play a specific audio file, and give the computer information for example, “Activating relay one” “Relay one off”. Each task it dose so I can observe from a pc, to see what the picaxe is doing. I also want to be able to debug the picaxe with the same serial cable. There will be multiple picaxes with this system that control different tasks, Sort of a serial network. Right now I am leaning toward the picaxe 28x, but because of my lack of experience with these and visual basic I do not know were to start. If anyone has thoughts or helpful ideas about this it would be greatly appreciated.

Thank you,
-Eric
 

hippy

Ex-Staff (retired)
Welcome to the PICAXE forum.

Geting a PICAXE to talk to the PC is fairly easy; the SERTXD command can send information back up the download cable while SEROUT and HSEROUT can be used for other configurations. Start with SERTXD to get a feel for its capabilities ...

Do
SerTxd( "Hello ericthemannn",CR,LF )
Pause 1000
Loop

Download that program, open the Terminal within Programming Editor, and guess what you'll see displayed :)

Getting the PC to do something, such as when the PIR activates, means having something running on the PC which can read the serial and respond. You could write your own PC application or perhaps find something ready made. You're really then getting into PC programming, eg VisualBasic etc, rather than PICAXE programming.
 

ericthemannn

New Member
First off, thank you both for the kind welcome.

2nd I'm still deciding which picaxe to buy, I'm going with the 18x so far, it has a lot of memory. what do you guys think?


I also came up with this quick test code with a pir input, dose this all look okay?
View attachment test picaxe code - Notepad.pdf

Thank you for all the help,
-Eric
 
Last edited:

Andrew Cowan

Senior Member
The 20X2 would be ideal. More memory, more flexable pins, faster, multiple program slots. However, as that is not yet released, the 28X2 would seem the best if you don't mind spending a few pounds more. It is so much more capable than the 18X.

A
 

ericthemannn

New Member
I just ordered the picaxe 20m just for experimenting and getting to know the picaxe, when ready and confident i will take you're advice and get the pic 28x i agree with what you say and think it's worth the extra $$.

Thank you,
-Eric
 

Wrenow

Senior Member
Eric,

If you will look at the specs, you will find there are basically 4 levels of Picaxe

The original, un suffixed (no M or X) parts, (08. 18, etc.), while dandy, do not have manuy of the features of the later parts. The original 08 is considered a "budget" item.

The M suffixed parts, which are the entry level / educational parts.

The X and X1 parts are the more or less "standard" range.

The new X2 parts add a lot of function and flexibility and are considered the "advanced" range.

Many are waiting with bated breath on the new 20X2 due to its flexibility and speed (looks to be a wonderful little workhorse).

Starting with a 20M is not a bad idea, as it is a pretty handy chip, and you can upgrade to the 20X2 when it comes out with little if any fuss.

Or, if you are under more time pressure, the 28X2 is pretty darned powerful.

A summary of the various ships is on p. 15 of the maual. I found it pretty handy to print the manual out and read through it some, as there is a lot of good information there.

Good luck!

Cheers,

Wreno
 
Top