Shop OBEX P1 Docs P2 Docs Learn Events
BASIC Stamp project questions — Parallax Forums

BASIC Stamp project questions

davidchlupacekdavidchlupacek Posts: 2
edited 2011-06-15 08:39 in BASIC Stamp
I have a question for a project i am working on, right now i have setup my microcontroller and have a switch on it, what i would like to do is when the switch is activated i would like the microcontroller to send a command to the computer and then at that point the computer would run a batch file. How would i go about doing this?

Comments

  • RiJoRiRiJoRi Posts: 157
    edited 2011-06-10 08:53
    More info is needed: your type of computer (IBM PC? MAC? TRS-80?), the OS (MAC? Windows-97? -98? -XP?) MS-DOS?); what kind of I/O is available (RS-232? Parallel port? USB?)

    What programming languages are you familiar with on your computer?

    --Rich
  • davidchlupacekdavidchlupacek Posts: 2
    edited 2011-06-10 12:00
    Well, i'm planning on using a computer running windows 2000, it will use rs-232, i'm familar with python and some visual basic, really all i'm wanting is a program to monitor COM7 ( the current com port the basic stamp is communicating with) to wait for a trigger command, once the stamp sends the command after a switch is activated, the progam on the computer runs a simple command (which will be to print a label) I'm currently working on the programming for the stamp which i believe i have about finished but i think my main questions will be on the pc side, so maybe i'll just have to google around for forums to help on that part.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-10 13:17
    There's a Nuts and Volts Column downloadable from Parallax (click on the Resources tab on the main Parallax webpage) that shows how to use the DEBUG output of the BS1 that erco mentioned.

    If you're using a BS2, you can use pretty much any program that will read from a serial port since the BS2's DEBUG statement produces standard serial data at 9600 Baud. For a single on/off switch, you could simply have the Stamp output a "0" when the switch is off and "1" when the switch is on, over and over again. The PC will just see a continuous stream of "0"s and "1"s and you can do anything you want with that.
  • merlinmerlin Posts: 40
    edited 2011-06-15 08:19
    Dear Mike
    I need to solve the problem in the opposite direction:
    I have a PC running Win 7 and some VisualBasic code. In certain condition, the PC will send a signal to a BS2 running on an Board of Education. The BS2 code has a loop looking for the signal (a word, or even a "1"); when the signal is reach, the BS2 will trigger some routine.
    The problem for me is: how to comunicate the PC with BS2? via the provided Serial Port on the board? Any other way?
    Any help (or examples) will be very useful
    Thanks and regards


    merlin
Sign In or Register to comment.