Shop OBEX P1 Docs P2 Docs Learn Events
How do I get the BS2 to write data to my hard drive? — Parallax Forums

How do I get the BS2 to write data to my hard drive?

Sean BarnesSean Barnes Posts: 6
edited 2006-09-06 21:54 in BASIC Stamp
Hello,

I'm interested in having the BS2 write data to my hard drive. I have the BOE attached to my computer with a USB cable. An explanation of what I'm trying to accomplish is as follows:

1) A light sensing circuit is using RCTIME to measure light levels.
2) When RCTIME exceeds a predetermined value, I want the BS2 to record that as a "hit".
3) The BS2 will record the number of hits for one minute.
4) At the end of the first minute, a file on the hard drive is created and the number of hits are written to it.
5) The process continues each minute and the hits per minute are appended to the file.

All help and guidance will be appreciated. Thanks.

Sean

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-06 19:31
    You need a program on your PC that opens the serial port (COM1, COM2, COMx -- the USB looks like a serial port to the PC) and recieves the data from the BS2. This program then opens a file on your PC and writes the data to that file.
  • GreenGiant83GreenGiant83 Posts: 43
    edited 2006-09-06 21:29
    Do you have any experience with C#, Visual Basic, or Visual Basic.Net? Writing the program that would do this would be a fairly simple matter, but you need to have a compiler of some sort, like Visual Studio.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-09-06 21:54
    StampPlot can be used to automatically send data to a computer file.

    From THe BASIC Stamp, you need to send:

    DEBUG "!LOGD ", DEC value,CR

    After LOGD, you can have any string, including a time stamp:

    DEBUG "!LOGD (RTIME) ", ..... your data,CR

    Prior to sending data, you can change the name of the data log file:

    DEBUG "!NAMD mydata.txt",cr

    On StampPlot, simply select the com port under "Configuration" and connect.

    http://www.stampplot.com

    Free for home.educational use.

    -Martin



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Southern Illinois University Carbondale - Electronic Systems Technologies

    Personal Links with plenty of BASIC Stamp info
    StampPlot - Graphical Data Acquisition and Control
Sign In or Register to comment.