Please Help
karumb2
Posts: 6
Hi group,
I am new to this and I need some help asap.·Does anyone know how I can open a text file, located on the PC and then based on
a unique number in the text file get a servo motor to turn either clock wise or counter clockwise. I know how the motor is conected and all but just need to know how to open the text file and then turn the motor based on the number in the file.
For Ex, one text file contains a 1- the servo turns clockwise, and·one text file contains a 2- the servo turns counterclockwise.
Can some one please help me as soon as possible. Your help is GREATLY appriciated!
·
I am new to this and I need some help asap.·Does anyone know how I can open a text file, located on the PC and then based on
a unique number in the text file get a servo motor to turn either clock wise or counter clockwise. I know how the motor is conected and all but just need to know how to open the text file and then turn the motor based on the number in the file.
For Ex, one text file contains a 1- the servo turns clockwise, and·one text file contains a 2- the servo turns counterclockwise.
Can some one please help me as soon as possible. Your help is GREATLY appriciated!
·
Comments
http://forums.parallax.com/showthread.php?p=572202
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
The PBASIC Stamp does not support any Windows or DOS commands, nor does it have any facility for interfacing with the Windows/DOS operating system directly. There are various methods for doing what you're looking to do indirectly however.
You could certainly write a small Windows/DOS application, or use an existing intelligent terminal program, and communicate with it using SERIN and SEROUT. Somewhat needless to say, whatever the Windows/DOS application, it would need to be running (started) before the Stamp could begin to interface with it at all.
Once you have the Windows/DOS application started, all that's required is for it to then "handshake" with the Stamp to establish initial communication and "prove" the communications link, then you can pass whatever information you choose to over that asynchrounous serial link. It would be the Windows/DOS program's responsibility to open the file in question, field the data, and then pass it on to the Stamp. It's not a terribly difficult task, but there is no "canned" solution of which I'm aware.
BTW - I couldn't find anything in the prior referenced thread either <shrug>.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (Bruce Bates) : 2/23/2006 2:58:12 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (neoteric) : 2/23/2006 4:03:05 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Using Chris's chain of thought...
Wouldn't that mean that anyone on the Internet could just take any of your files? After all, they are "connected" to your machine in the same way that a PINK is.
In short, you must have something running on the device that actually "has" the hard drive (in your case, a PC) that can read the drive (handle all the low-level stuff like figuring out where on the drive the file exists and directing the drive electronics to move the read/write head and get the bits) and "give" the information to the requesting device (in your case, the Stamp). This is not a difficult task, and has been covered numerous times on these fora. Start with learning something about the Stamp...the free "What's a Microcontroller?" text is a very good place to do so...and then work your way up.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com