Shop OBEX P1 Docs P2 Docs Learn Events
range sensor + encoder + motor controller — Parallax Forums

range sensor + encoder + motor controller

tehmoordartehmoordar Posts: 52
edited 2005-05-06 19:08 in BASIC Stamp
HI,
I need to adjust my code as such that my motors should be runing and I am conitnously getting range and encoder giving me the rpm of my wheels.
I am using pololu micro dual motor controller. Which I am telling in the code to move from 50 to 127 that is its maximum speed.

I am attaching my code and I have been trying ti fix it but once it goes into speed of controlling motors it stops giving me my range and rpm -- what should I do
Thanks

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-05-06 16:25
    I think if you take your debug statement at the beginning (initialization)of the code and add it to the "Get_sonar" section of your code it should work for you.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • tehmoordartehmoordar Posts: 52
    edited 2005-05-06 17:25
    Hi
    I have done the mdification as you suggested. I am not sure whether I have done right as you suggested . Have a look at it.

    What happenig is that one it reads range and then it goes into main: and the it does speed up the motor as specified slowly and then stays there. I want once it is speeding up the motors it should continue to updating range and rpm aswel. All functions to happen simultaneously..

    I am not getting what I want.
    Thanks
  • dandreaedandreae Posts: 1,375
    edited 2005-05-06 17:34
    That's not what I was thinking, try this code that is attached.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com
  • dandreaedandreae Posts: 1,375
    edited 2005-05-06 17:40
    I made a correction to the·code,·so try this one·and see if it works for your project?

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com
  • tehmoordartehmoordar Posts: 52
    edited 2005-05-06 18:43
    If I make the correction like this( see attachment) although updating is slow but you see the motors start earlier and and I miss initial data of range sesnor and encoder.
    Can I make it more quickly update the data of the sensors. at the moment to me it look jerky.
    Thankyou for your help.
  • dandreaedandreae Posts: 1,375
    edited 2005-05-06 19:08
    You are going to have to experiment with the code to get it perfect.· I don't have your set up here to test.



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
Sign In or Register to comment.