Shop OBEX P1 Docs P2 Docs Learn Events
Visual Basic to BS2p-40 — Parallax Forums

Visual Basic to BS2p-40

JedwoodJedwood Posts: 2
edited 2010-11-07 14:34 in BASIC Stamp
I have built a firework launching system which is controlled by a BS2p-40.
I use a combination of 1-5 (Banks) and 11-20(Channels) in a matrix to control 60 individual relays to ignite the firework fuse. Currently the program runs through all 60 fireworks individually, by taking OP1 high and OP11 high, I can switch one relay, then OP1 high and OP11 high I can switch the next relay etc. This system is tried and tested and works perfectly, but takes the fun out of igniting fireworks. The next evolution in my head is to try to control this sequence individually at the click of a mouse, using VB and a serin command.
For instance, clicking on an icon in VB will send a serial code to the BS, and it will then follow this command with a certain combination of OP high commands. 60 VB buttons = 60 fireworks. I just need some help with the VB to serial output, and SERIN to outputs on the BS2.
It’s as simple as:

In VB, Double click button 5, VB will output 00000101 (dec 5)
BS2 receives serial 00000101 and takes OP 1 and OP15 high, wait 2000, OP1 OP15 low.

In VB, Double click button 12, VB will output 00001100 (dec 12)
BS2 receives serial 00001100 and takes OP2 and OP 12 high, wait 2000, OP2 OP12 Low, etc....

I hope I have been able to explain this sufficiently. If anyone is interested I can post some photos and schematics of the system.

Great forum by the way!

Any help is appreciated.
John

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-11-05 15:43
    Looks like you have a good understanding of your objectives. the VB code is what will be the user interface and as you say the two will talk serial. Do you have any code you have questions about or specific issues you need addressed? Later you might work on selecting multiple shots and firing them together.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2010-11-05 16:13
    Hi , there are a few tips for getting started at this link

    http://forums.parallax.com/showthread.php?t=96973

    Jeff T.
  • JedwoodJedwood Posts: 2
    edited 2010-11-07 14:34
    Franklin, selecting multiple shots and firing them together. A great suggestion. I guess this will depend upon how well I can drive VB, but ideas are forming in my head as we speak. Thanks!

    Jeff, thanks for the link. I haven’t been able to explore it fully, but what I have seen looks very interesting. Thanks very much.

    John
Sign In or Register to comment.