Shop OBEX P1 Docs P2 Docs Learn Events
VB2005 Express to a BS2 — Parallax Forums

VB2005 Express to a BS2

bennettdanbennettdan Posts: 614
edited 2007-03-20 06:44 in Robotics
Hello,

I thought I would share this with some people its a small applet created in microsofts free Visual Basic Express 2005 you can download it from here http://msdn.microsoft.com/vstudio/express/vb/download/

Be sure to download the program to the stamp then close the Basic Stamp software first so you can connect to the stamp with Port 16.
Just add a couple of LEDs to the stamp·pins 3 and 4 be sure to use resistors in series with the LEDs.

··· Then you can modify the code to be used with your Com port to the stamp, In the VB2005 code go to the code behind Form1 then Change "Com1" to "Com(Your Port)" then select F5 to run the project.

Also if you have a EB500 and want to use this the uncomment the lines in the BS2 that say to be uncommented and comment out the single line that says to.




Post Edited (bennettdan) : 12/28/2006 8:29:07 PM GMT

Comments

  • Rob311Rob311 Posts: 83
    edited 2006-12-29 04:55
    I don't know much about serial programing, or VB.net, but i do have some questions.

    1) I notice you don't have a 'connect' button. It looks like the program connects when the forum initiates, but if you could confirm this i would sleep better at night.

    2) Will the same code work with a ppc program? as far as i can tell this program is written for windows. again, my ignorance is showing, but would i be able to send this code (in a different base application) to my ppc?

    Thanks for posting this, i foresee myself gaining many an hour of sleep because you already wrote this code =)

    ~Rob
  • T ChapT Chap Posts: 4,223
    edited 2006-12-29 12:15
    Realbasic is an app that VB programs can be ported to with some work, and after doing so, can run on a Mac or Linux.
  • bennettdanbennettdan Posts: 614
    edited 2006-12-29 14:19
    Rob,

    In the 2005express code under the Form_load is where it tries to connect to the serial port, and in the Form_Close is where it closes the serial port. You can put in a button to to connect and one for disconnect if you want also you can put in a list box to change the Com ports and baud settings if you need it for your application.

    The VB2005 express code as far as I know will not support the Pocket PCs I looked on the MSDN websight and could not find a PPC SDK for 2005express. I use VB2005.net Pro to create PPC applications but if you only have the 2005express then you can make up the form and code debug it and then send it to me and I can copy and paste it into a PPC application you can download to your PDA through Active Sync.

    I hope this helps.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-12-29 15:45
    Here is another thread with some VB.Net code that you can mess around with:

    http://forums.parallax.com/showthread.php?p=607328
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2006-12-29 21:06
    Hi bennettdan, I like Visual Basic for its ease of use for creating a simple Stamp interface. I like your use of the Try Catch routine it is something I'm trying to get more familiar with. I have several small apps with buttons and gauges etc that I use for testing Stamp code, it will never replace all the hardware but it cuts cost on quite a few devices. My most recent is a serial·LCD display if you would like to try it PM me with your e-mail and Ill send a copy.·The Stamp coupled with VB has also given me a greater understanding of serial comms·which I continue to learn.

    Jeff T.
    400 x 285 - 34K
  • bennettdanbennettdan Posts: 614
    edited 2006-12-29 23:59
    Hey Unsoundcode

    I have some more ways to setup your serial connection kind of like Hyperterminal where you can set baudrate and it will list the avaliable com ports and things like that...let me know and I will post some more if you need it I also have some LCD software I will share just zip up what you got and post it I would like to see what you have also..

    I am trying to find VB2003.net ( cant buy it new) so I can program with the Speech SDK and have a speech controlled robot and some home automation goodies.

    Post Edited (bennettdan) : 12/30/2006 9:18:21 PM GMT
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2006-12-30 19:18
    I see on a separate post you may be getting VB2003.net, good deal. The idea of a Stamp being able to·use speech·through a VB computer interface is an interesting prospect that I intend to look into further. The SDK 5.1 page says Visual Basic but does not mention a version.

    I zipped the LCD and included a small .txt file with a few pointers and also included a demo.bs2. If you try it (or if anyone would care to try it) feedback is welcome. My ultimate aim is to have a compilation of various utilities as a cd with simple labs that interface the Stamp and PC.

    Jeff T.
    exe
    335K
  • bennettdanbennettdan Posts: 614
    edited 2006-12-30 21:17
    The speech SDK you want to look into is SASDK 1.1
    at this websight http://msdn2.microsoft.com/en-us/library/ms986944.aspx it only works with VS2003.net though that is why I am looking for it. The SDK 5.1 is a text to speech SDK not Speech to text like the SASDK 1.1

    I like the LCD applet by the way.
  • bennettdanbennettdan Posts: 614
    edited 2006-12-30 21:33
    Unsoundcode

    In your LCD program your text document says you need to limit data to no more that 20 scan cycles from the BS2 or you can have garbage displayed how are you bringing in the data into the program.

    If you use the serialport.readexisting() command it should not matter how many times you input the data I think..

    Also you might need to increase your serialport.readTimeout setting to a longer time
    Do you mind sharing the source code my email is bennettdan@bellsouth.net.

    Post Edited (bennettdan) : 12/30/2006 9:39:42 PM GMT
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2006-12-30 21:43
    Hi bennettdan, I use event driven serial input to VB, that is whenever the port sees input it grabs it, that way I dont need a handshake. The problem is if the display is refreshed too fast the VB input cannot process the info and update the display fast enough and it is possible the input can become garbled. So to prevent that happening the display refresh rate should be slowed down some. So what I mean is dont send too much too fast.

    I hope I explained that ok, it shouldnt be·too big a deal anyway.

    Jeff T.
  • MasterXMasterX Posts: 3
    edited 2007-03-11 01:00
    Got this working nicly thanks,

    My question is how would i send an input from the board like a switch 1 to the VB program
  • bennettdanbennettdan Posts: 614
    edited 2007-03-12 02:52
    Well without knowing what exactly you want to send here is a really good sight that inputs data from a stamp check it out.

    http://www.devx.com/dotnet/Article/32278/0/page/1
  • MasterXMasterX Posts: 3
    edited 2007-03-17 16:27
    Simple integers, 0 1 86 somthin like that

    if input1 is high send 5 and then VB will do what 5 means

    thanks i'll check that out too
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-03-18 17:07
    MasterX I have a small app with 6 I/O and 2 servo controllers via a serial com port to a Stamp. If you think it might be what your looking for PM me your email and I will zip it up.

    Jeff T.
  • MasterXMasterX Posts: 3
    edited 2007-03-20 06:44
    I don't think so,
    i complete understand VB - Stamp,
    but i don't can't get Stamp - VB to work
Sign In or Register to comment.