Basic stamp communication through visual studio
SD2PO
Posts: 11
Hello,
I am working on a object detection system. I currently have the Basic Stamp Homework Board. At first I was going to try to do things wirelessly but time has been shortened and so I am wanting to run everything off of one machine. I am new to Basic stamp and was wondering is there anyway I could communicate through the Serial-USB to my laptop and see the data that is coming from the Basic Stamp....Based on Status change 0,1, send an email to a customer.
Thanks...Please Someone Help!!
I am working on a object detection system. I currently have the Basic Stamp Homework Board. At first I was going to try to do things wirelessly but time has been shortened and so I am wanting to run everything off of one machine. I am new to Basic stamp and was wondering is there anyway I could communicate through the Serial-USB to my laptop and see the data that is coming from the Basic Stamp....Based on Status change 0,1, send an email to a customer.
Thanks...Please Someone Help!!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
ObjectDetectBox1 VAR Bit
DO
FREQOUT 8, 1, 38500
OjectDetectBox1·= IN9
DEBUG HOME, "ObjectDetectBox1 = ", BIN1 ObjectDetectBox1
PAUSE 1000
LOOP
What would I do to call this information through Visual Studio C#? I am wanting to read from the Homework board when the box has an object...to send an email to a contact in a specific database.
Please could anyone help me? I am not familiar with the coding.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I have a few questions. Ok I have ran a few programs with help for the VS2008 end to access my serial port. Now I have a question about basic stamp 2 supporting interrupt commands. For instance when Pin1 = 0, then changes to 1 because of the object being detected, I want the project to awake upon interrupt. So in other words when someone inserts an object and blocks the emittance of light I want the machine to become active instead of being active the whole time. Also, Stephen I do not quite understand your previous post. <whatever a 0x1 would be to VC++> also I am using C#, not C++. Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
DEBUG "pin 9 is high", CR
when you get that part working so it sends the message when it sees the sensor activated and sends nothing or another message when not then post your code here and we can discuss the next step.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
' {$PBASIC 2.5}
'
Declarations
BoxIR1 VAR Bit
BoxIR2 VAR Bit
BoxIR3 VAR Bit
BoxIR4 VAR Bit
'
Main Routine
main:
FREQOUT 7, 1, 38500
BoxIR1 = IN8 ' Store IR detector output in RAM.
FREQOUT 1, 1, 38500
BoxIR2 = IN0
FREQOUT 8,1, 38500
BoxIR3 = IN9
FREQOUT 0,1, 38500
BoxIR4 = IN1
DEBUG HOME, "Box1= ", BIN1 BoxIR1
PAUSE 20
DEBUG " Box2= ", BIN1 BoxIR2
PAUSE 20
DEBUG " Box3= ", BIN1 BoxIR3
PAUSE 20
DEBUG " Box4= ", BIN1 BoxIR4
PAUSE 20
GOTO main
Debug Terminal
Box1 =
Box2 =
Box3 =
Box4 =
This program....displays a 0...when there is nothing there....and a 1 when there is something blocking the emitter and receiver. So now comes how do I read it through Visual Studio. I know I want to either use SEROUT or POLLIN commands but I do not understand the syntax.
Thanks
SEROUT pin, baud, <formatter> data
Also if you plan to have four sensors it would be a good idea to have them on four adjacent pins. Take a look in the help file on IN1 and INA.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Post Edited (Franklin) : 11/18/2009 4:18:21 PM GMT
What part of this do you have done?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Typically you'd send a character or a couple of characters every now and then from the Stamp to the PC. The choice of characters depends on whether the sensor detects something or not. The Visual XXX program sits there and receives whatever is sent from the Stamp. When the received data indicates that the sensor has sensed, then the Visual XXX program can do something.
Post Edited (Mike Green) : 11/19/2009 5:36:38 PM GMT