Shop OBEX P1 Docs P2 Docs Learn Events
Sending output instead of comment? — Parallax Forums

Sending output instead of comment?

w00t_86w00t_86 Posts: 12
edited 2011-01-11 22:38 in General Discussion
Have a problem with regards to the SEROUT function of my Basic Stamp BS2sx. The problem is that now i am interfacing with a motor driver that controls 2 DC motors and takes in 4 inputs from my stamp. It takes in serial data and in the form of '1''f''4''/r'. The '1' indicates the 1st DC motor, the 'f' indicates the direction of the motor's rotation, the '4' indicates the percentage of the motor's output speed in the range of 0 to 9. The '/r' indicates the end of data.

The problem i have is that whenever i type in the ' key into the editor, it registers the next letters as comments instead of data that i have to send out. Would anyone have a solution to this?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-11 20:06
    Could you attach the PDF doc for your motor controller, please? I suspect there are several things wrong with that command string, but I don't want to speculate until I'm sure.

    Thanks,
    -Phil
  • w00t_86w00t_86 Posts: 12
    edited 2011-01-11 20:15
    Could you attach the PDF doc for your motor controller, please? I suspect there are several things wrong with that command string, but I don't want to speculate until I'm sure.

    Thanks,
    -Phil

    I've attached the PDF doc. Fingers crossed that i do have something that is actually compatible with my Basic Stamp.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-11 20:44
    Okay, I see what's going on. The apostrophes are just single quotes and not part of the command. The '/r' is a carriage return. So your command string would look like this:
    "1f4", 13
    
    -Phil
  • w00t_86w00t_86 Posts: 12
    edited 2011-01-11 22:38
    Okay, I see what's going on. The apostrophes are just single quotes and not part of the command. The '/r' is a carriage return. So your command string would look like this:
    "1f4", 13
    
    -Phil

    Wow. It works really well! Thank you Phil!
Sign In or Register to comment.