View Full Version : Keyboard control help
11-16-2010, 05:29 PM
I am trying to figure out how to use keyboard input to control my motors(like press w to go foreward, s to go backwards etc.) can someone give me a couple of example lines to get this done? for now, the board will be connected right to the computer. also, i do now know how to make it so, while the program is runing, pressing buttons will not type into my code
11-16-2010, 06:09 PM
You said that you want to use your computer to control your Propeller? No problem. The Fullduplexserial and Parallax serial terminal objects allow for bi-directional data transfer... Go to the Propeller IDE. You will have to go to Propeller demos and it should be under "Parallax Serial terminal demo". This will give you a good way to start understanding the protocol... Another option is to hook up a PS/2 keyboard. That way you would not need to be tethered to a computer and it is easy to interface....good luck
11-16-2010, 06:44 PM
i went and looked at that, but it only confused me more. i have very little understanding of spin code, i am still trying to figure out how to position a servo.
11-16-2010, 06:54 PM
i have very little understanding of spin code, i am still trying to figure out how to position a servo.
I think you should start with learning Spin and debugging using your PC. The Propeller Education Kit Labs are a good starting point (here (http://forums.parallax.com/showthread.php?t=89958)).
11-16-2010, 10:19 PM
I do look foreward to learning spin, but at the time I dont have that as an option. see I need this for my senior project, and when i started i figured it would be similar to BASIC, but now im in over my head and dont have time to learn a new program.
11-17-2010, 03:15 AM
What kind of motors do you mean? Are you referring to servos, steppers, AC or regular dc hobby motors? You are going to need a few external components to get your motors to move under the direction of your program. You could buy a cheap H-Bridge IC or you could rig up something quick and dirty using a couple of transistors/ diodes. But that depends on the type of motor you are using... I think Mike is right about trying to come at the Propeller slowly. If you keep at it you CAN learn it quickly. It took me a couple of weeks to get the gist of SPIN(although i still don't know everything)...
11-17-2010, 01:55 PM
they are the motors on stingray robot
11-17-2010, 04:48 PM
Do you have just the motors? Or do you have the whole stingray robot? If you have the whole robot than it should be easier to interface. Have you ever moved the motors at all yet?
If is kinda hard to help you out with code if i don't know very many details. The more you supply the more we can help