Shop OBEX P1 Docs P2 Docs Learn Events
Is it Possible? — Parallax Forums

Is it Possible?

A.C. fishingA.C. fishing Posts: 262
edited 2006-03-29 22:05 in BASIC Stamp
Is this possible, and how?
input from a temperature sensor will go to the BS2, and then up the Serial Cord, through the adapter and Make a graphic move?(I'm using Flash MX for the graphics and motion clips). How can the BS2 tell the rest of the computer the temperature, and load it in another program? Like if the temperature < 50 then the a = 1, temperature = 50, a=2, and if temperature > 50, a=3. But how can the rest of the computer use this?
Thanks

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-03-29 22:05
    You program a simple program into the BS2, which basically reads the sensor, sends the data, then repeats:

    SensorData VAR WORD
    SensorPin CON 2 ' Or whatever pin...
    TxPin CON 16
    MyBaud CON 16384 ' 9600 baud, inverted --

    Main:
    · GOSUB ReadSensor
    · GOSUB SendData
    · pause(1000) ' Wait 1 second
    · GOTO Main

    ReadSensor:
    ·· ' Stuff to put the sensor data in SensorData
    RETURN

    SendData:
    · SEROUT TxPin, MyBaud, [noparse][[/noparse]DEC SensorData, 13]
    · RETURN

    Ok, now you program your PC (somehow) to read the serial port. Based on the value
    read from the serial port, your PC (somehow, varies by language) updates the graphics.
Sign In or Register to comment.