I see broadcast examples for setting a motor’s speed, e.g. MA100, and for position, e.g., MAP180. Works great.
- But how do I do a position command at less than full speed, i.e., Motor A at 50% speed to position 180?
Tried to simulate this in a loop, i.e., run the motor at low speed, watch the encoder value and stop when I get to the right position. But couldn’t get the encoder value dynamically. So:
How do I read the encoder value for Motor A? (Seem to be running into a “have to broadcast once to the sensor before reading a value” bug?)
While I’m at it, saw various motor control messages, mentioning PID controllers, etc., but appeared to be for the Python interface. Any of these available in the Scratch environment. Which leads to the following question:
I suspect the only “official” doc for the BrickPi Python API is the code itself. So I’ll go look at it. Is it possible to get at all the functionality in this API by doing “broadcasts” from Scratch? That is, is the Scratch API just a thin shim that marshals the text string argument from the Broadcast and conveys it to the Python API, and suitable return?
Mike (attempting to use BrickPi for teaching robotics to kids