Shop OBEX P1 Docs P2 Docs Learn Events
Reading in Data — Parallax Forums

Reading in Data

nickrummelnickrummel Posts: 13
edited 2010-12-05 15:03 in BASIC Stamp
Hello,
I'm kind of new with basic stamp... I have a board of education (USB) with the BS2. I'm going to have a stepper motor hooked up, which I actually know how to program and everything. However, I'm making something that uses a Dataq (Data acquisition) to record data (in the form of volts). What I want to do is have the motor rotate based on the the current voltage being recorded. For example, the Dataq will be continuously recording data, and if the values are 0-3 V I want the motor to rotate clockwise, if 3-5 V no rotation, and if 5-8 V rotate counter clockwise. So my question is, can the basic stamp read in this real-time data? Or do you have any suggestions for a way I can do this??

Thanks!
-Nick

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-12-04 20:36
    Which version of the Dataq? Is it serial?
  • nickrummelnickrummel Posts: 13
    edited 2010-12-04 20:49
    It's a DI-158U which is USB
  • FranklinFranklin Posts: 4,747
    edited 2010-12-05 11:00
    You will not be able to connect that directly to the stamp and will have to use a computer or USB host device between the two.
  • nickrummelnickrummel Posts: 13
    edited 2010-12-05 11:44
    That makes sense. What I'm thinking is having the Dataq plugged into my computer and read in Matlab. So is there a way to call that data into basic stamp through Matlab? Or... have a program in Matlab that interprets the Dataq data, and if the voltage is 0-3, then tell basic stamp to rotate the motor clockwise, 3-5 stop the motor, and 5-8 rotate counter clockwise?
  • FranklinFranklin Posts: 4,747
    edited 2010-12-05 15:03
    If Matlab can send serial data to a comport on the computer you can write a program on the stamp that will receive that data (commands) and perform a function depending on what the data was. There is some instructions on controlling the boebot remotely on the Parallax site.
Sign In or Register to comment.