Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard control help — Parallax Forums

Keyboard control help

Connor149Connor149 Posts: 25
edited 2010-11-17 08:48 in Propeller 1
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

Comments

  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-11-16 10:09
    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
  • Connor149Connor149 Posts: 25
    edited 2010-11-16 10:44
    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-11-16 10:54
    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).
  • Connor149Connor149 Posts: 25
    edited 2010-11-16 14:19
    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.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-11-16 19:15
    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)...
  • Connor149Connor149 Posts: 25
    edited 2010-11-17 05:55
    they are the motors on stingray robot
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-11-17 08:48
    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
Sign In or Register to comment.