Visual Basic and Basic Stamp!
Lideman
Posts: 6
Hallo everyone. I'm from Brazil and I need some help. I need a way to make a Visual Basic software that can controls servo motors using Serial port using one Basic Stamp. Is that possible? PLease i try to find a way but it seems impossible.
SO i hope you can help me.
Thanks for reading this.
Best regards for all!!!
SO i hope you can help me.
Thanks for reading this.
Best regards for all!!!
Comments
- In VB, drop a Serial Port control on your form.
- In Form_Load type SerialPort1.PortName="COM1", then SerialPort1.Open().
- To send data, write SerialPort1.Write().
- Prefix your data from the PC with a "!". For example, type SerialPort1.Write("!750")
On your Stamp:
ServoPos VAR Byte(3)
SERIN port, baud, [noparse][[/noparse]WAIT("!"), str ServoPos\3]
.. then send ServoPos to your servo.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
Thanks for the aswer, but don't ou have a complete tutorial? I Don't know how to use Visual basic.
Thanks again.
The main problem you will run into is that the Stamp can only do one thing at a time. When it's listening for data from the PC, it can't produce the servo control pulses needed. You can use either the PWMpal or the ServoPAL to take over the generation of the servo control pulses from the Stamp. The PWMpal has 4 channels (and you can only use one with a Stamp) while the ServoPAL has 2 channels and you can add as many as you need with each ServoPAL using one I/O pin.
There's no complete tutorial. You may be able to find some examples by browsing back through this forum or the Completed Projects or the Sandbox forums. You will have to learn Visual Basic and Stamp Basic. There's no getting around it.
Post Edited (Mike Green) : 8/7/2009 2:55:13 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
Hi i made some researshs on internet and finaly i discovery a way to creat. I wastrying to use this program and i had sucess. But now i wanna creat my own software like this one in the webpage, how can i make this using visual basic? Thanks again.http://www.rentron.com/servo.htm
The webpage you showed is for a demonstration program. The technique they showed will not work for smooth, continuous servo motion. When the Stamp waits to receive data from the PC, the servo will twitch or slip slightly and that may or may not be acceptable for what you want.
There is a free program called StampPlotPro available from Parallax (www.parallax.com/tabid/441/Default.aspx) or from the author (www.selmaware.com) that runs on a PC and, in addition to plotting data from the Stamp, allows you to set up controls that the Stamp can "read". You can use this to learn how to communicate between a Stamp and a PC.
http://forums.parallax.com/showthread.php?p=671804
Jeff T