serin and VBA

Hi.

I'm looking to create a picaxe project which will send a signal to computer via USB. Ideally, I dont want to have to use the programming cable for that. Is there a way to do it using serin and a normal USB cable?

When the computer receives the signal, I want to use Powerpoint and Visual Basic to create a list of multiple choice answers on the computer screen, which can be answered by pressing the appropriate switch attached to the picaxe - which will then register on the screen in some way.

Has anyone had any success with this sort of thing, and could point me in the right direction with the computer side of things?

Many thanks
Jon
 

nick12ab

Senior Member
I'm looking to create a picaxe project which will send a signal to computer via USB. Ideally, I dont want to have to use the programming cable for that. Is there a way to do it using serin and a normal USB cable?
You have to use a USB-to-serial cable or adapter (well you might be able to use a parallel port or a game port). The AXE027 programming cable is just a USB-to-serial adapter.

When the computer receives the signal, I want to use Powerpoint and Visual Basic to create a list of multiple choice answers on the computer screen, which can be answered by pressing the appropriate switch attached to the picaxe - which will then register on the screen in some way.
See here for some info about using serial ports with VBA.

It definately looks possible with PICAXE - for small numbers of answers a little 14M2 or 08M2 would do! You could also have computer-controlled LEDs byu connecting said LEDs to the PICAXE.
 
You have to use a USB-to-serial cable or adapter (well you might be able to use a parallel port or a game port). The AXE027 programming cable is just a USB-to-serial adapter.

See here for some info about using serial ports with VBA.

It definately looks possible with PICAXE - for small numbers of answers a little 14M2 or 08M2 would do! You could also have computer-controlled LEDs byu connecting said LEDs to the PICAXE.

Thanks. I think a play with that after christmas is definitely in order. Would a 20m do the job? I have some of those laying around somewhere. If not, I'll have to buy in some M2's
 

nick12ab

Senior Member
Thanks. I think a play with that after christmas is definitely in order. Would a 20m do the job? I have some of those laying around somewhere. If not, I'll have to buy in some M2's
How many inputs do you need? If you only need 8 or less, then the 20M will do the job.
 
probably 5 maximum. i've just found some 20m2's too so im golden. was wondering if a 20m would support sertxt. is there a better command to feed serial data back to the computer though? I only want to send to the computer if an input switch has been pressed or not, so Im guessing sertxt is ok, but if theres something better... I was wondering about using a standard output with serout, but not sure how I would connect that to a serial to usb cable. Doesnt really matter which, i want simplicity and reliability.

Part of me wishes you hadnt replied so quick... i was going to do this after christmas but now its bugging me!
 

nick12ab

Senior Member
Sertxd will work on the 20M and will be fine. Don't forget you can increase the speed by changing the frequency using the setfreq command:
setfreq m8 - 9600 baud
m16 - 19200 (M2 parts only)
m32 - 38400 (M2 parts only)
 
got it working in VBA - VBA recognises a sertxd output from the picaxe and does stuff with it.

Will post all the programming etc somewhere when its complete incase others find it useful.

Thanks
 
Top