Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing PBASIC with Visual Basic — Parallax Forums

Interfacing PBASIC with Visual Basic

darth_mascursedarth_mascurse Posts: 14
edited 2007-08-29 01:26 in BASIC Stamp
Hi!

Would anyone here happen to know if there is any way to make a Visual Basic mask for a PBASIC program?

I need it to make an everyday use program for dimming lights.· I only need the controls to be in Visual Basic or some other visual programming language.

Thanks!!!!!
«1

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-08-29 00:48
    The basic stamps communicate to the outside world using serial protocols. If your program can send and receive serial you can communicate tot the stamp. The rest is programming.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 00:51
    do you know of any way to directly interface PBASIC with a visual mask?

    I have the PBASIC file if you want to look at it.
  • FranklinFranklin Posts: 4,747
    edited 2007-08-29 00:54
    What is a visual mask?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 00:55
    I give, what's a "Visual Basic Mask"?
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 00:55
    A mask of controls in VB or another visual language that controls another language...in this case PBASIC
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 00:57
    oh, so you don't have the pbasic editor and you want Visual Basic to create a PBAsic file from something you make in Visual Basic?
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 00:57
    no, I have both, I just want the program to look real
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 00:58
    ok, define real
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 00:59
    as in, what programs on everyday computers look like
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 01:00
    so you want a vb program to show the stamp and l/o lines out of the stamp with pictures of you leds going on/off according to the pbasic program?
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:01
    noooo....I want the program to be in PBASIC, but I want to control the program using a visual mask...in VB or another visual mask
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 01:02
    oook.

    hold on.
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:03
    i can't stay on long...I may have to see it tomorrow!
  • pwillardpwillard Posts: 321
    edited 2007-08-29 01:05
    Pbasic is written on the PC and then (for lack of a better word)·compiled and then·"flashed" into the Basic Stamp. It doesn't run on the PC so VB would have no access to it if that's what you are thinking.· You need to set up an MSCOMM control in your VB program to talk with the Stamp.· Once programmed and running, the STAMP could care less if the PC is there... even with DEBUG statements... it would just print them to thin air.

    http://www.users.on.net/~cit/html/visual_basic_mscomm_control.html

    ·It's likely any other mechanism you can come up with will use the same or more interface pins to talk with the PC while it's running. You then create a protocol so VB and the Stamp know what each is saying.· As it was said above... the rest is programming.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 01:06
    oh I should ask are you using vb 6 or vb.net (2005)

    my test program (vb.net 2005 express) doesn't always like to connect to the rs232 port, something about vb.net.

    then the next question is the stamp telling your vb program want to light up? or is your vb program have buttons on it and making something on your stamp light up? or both?
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:06
    so, I can possibly make a program to completely replace PBASIC?
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 01:07
    It's likely any other mechanism you can come up with will use the same or more interface pins to talk with the PC while it's running. said...


    nope that's it
  • pwillardpwillard Posts: 321
    edited 2007-08-29 01:07
    darth said...
    so, I can possibly make a program to completely replace PBASIC?


    no, not likely


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.

    Post Edited (pwillard) : 8/29/2007 1:14:07 AM GMT
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:07
    I want to have buttons on the screen to control the lights, I have Vis.net
  • FranklinFranklin Posts: 4,747
    edited 2007-08-29 01:07
    What you want can be done. You just need to have your controls send serial data to the stamp where the stamp will execute code depending on what was sent.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:08
    so what I should do is send commands to the Stamp to execute PBASIC code prewritten in the EEPROM??
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 01:09
    let me find my two programs (VB & pbasic) that I have, give me a couple of secs.
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:11
    I'm not really looking for anything automatic, I just want to know a basic idea of what I need to do to make the stamp program actually look real on the PC
  • pwillardpwillard Posts: 321
    edited 2007-08-29 01:13
    Darth... Stamps are very real. Hardly fake even. I think we are stumbling on what you mean by real.

    I have a feeling what you want has already been done.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • FranklinFranklin Posts: 4,747
    edited 2007-08-29 01:14
    Sure, the vb would send an "F" to the stamp and the stamp would read the serial input, get the "F" and do the code associated with the "F". It could also send back data to the vb program the same way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:14
    i just want a screen to control the Stamp that looks more realistic than the Debug window
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 01:15
    check these files, one of the pbasic ones work with the vb one.

    the vb prgm has three options (red yellow green) you click on the one you want to light up on the stamp.
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:15
    could you kind of show me a sample of code that would do that?
  • cyplesmacyplesma Posts: 76
    edited 2007-08-29 01:17
    with those programs the vb one send a "R" "Y" "G" to the stamp the stamp uses that to light up one of five pins, you set one of the pins for red led one for yellow led and one for green led.

    like I said the vb .net (2005 express) rscom control does seem to be a little flakey for me so if you can find a way to unflake it please let me know.
  • darth_mascursedarth_mascurse Posts: 14
    edited 2007-08-29 01:18
    btw, I'm using the USB version
Sign In or Register to comment.