Menu

#30 OnFwd no effect when input is variable

general
closed-rejected
NBC (24)
5
2014-08-17
2007-08-21
No

Strange enough, the following work correctly:

OnFwd(2, 100)
OnFwd(4, 100)
set w, 2
OnFwd(w, 100)

however this seems not to work:

set w, 4
OnFwd(w, 100)

attached program demonstrates the problem
(attach motors to all 3 ports)

Discussion

  • Pavel Petrovic

    Pavel Petrovic - 2007-08-21
     
  • Nobody/Anonymous

    Logged In: NO

    Same result with the enhanced firmware.
    (thanks you for the news that the shift operations are implemented there already!)

     
  • John Hansen

    John Hansen - 2007-08-22
    • status: open --> closed-rejected
     
  • John Hansen

    John Hansen - 2007-08-22

    Logged In: YES
    user_id=661666
    Originator: NO

    The value 4 is not a valid port or set of ports. When you use a constant, the value OUT_AC (4) is automatically converted into an array of ports containing 0 and 2. If you use a variable with any of the motor commands it MUST be an array containing a list of ports OR it must be a scalar value of OUT_A (0), OUT_B (1), or OUT_C (2).

    You should really never use anything other than the OUT_A, OUT_B, OUT_C, OUT_AB, OUT_AC, OUT_BC constants unless you really need to use a variable, in which case you need to follow the guidelines I mentioned above.

    John Hansen

     
  • Pavel Petrovic

    Pavel Petrovic - 2007-08-22

    Logged In: YES
    user_id=9375
    Originator: YES

    Thank you very much for the explanation, now I see that.

     
  • Pavel Petrovic

    Pavel Petrovic - 2007-08-22
    • status: closed-rejected --> open-rejected
     
  • John Hansen

    John Hansen - 2007-08-22
    • status: open-rejected --> closed-rejected
     
MongoDB Logo MongoDB