3

I have managed to write a small C# program that lets me play around with the WeDo 2 hub. I can read sensor values or set the speeds of up to two connected WeDo motors independently (I am aware that Lego says that this is not a good idea). The program is slightly similar to what is being done on this link, just (so far) more ugly and less sophisticated. For reading the sensor values, I got some really useful hints from this German-language article.

Anyway, this means it is now almost possible to build a remote controlled car with steering. The only thing that is missing is some way to verify that the steering is in neutral position. For this, it would be practical to have some way to read the current motor position (or angle) and/or to tell the motor to go to a certain position (or angle).

I have tried this:

  • I have tried using some of the commands mentioned in this piece of documentation. However, none of them worked, except plain StartPower(Power). Given that the Guids mentioned in the document were not particularly helpful when trying to make the WeDo 2 hub work as expected, this document may not be very relevant here.

  • I have tried reading sensor values, but I did not get any values for the port that the motor is plugged into. For the two "real" WeDo sensors, one has to perform an initialization before they provide values. I do not know if or how it is possible to initialize the motor in order to provide its current position or angle.

  • I have tried using the LegoDeviceSdk. But this does not seem to offer anything beyond "turn with power X" either.

Any ideas how I could get a motor position, or make the motor rotate to a desired position?

3

Based on the answer to this question and some experiments with other hubs and other motors today (Boost hub + Boost motor + small PoweredUp hub), it seems that the WeDo motors really lack any ability beyond "Run with power X". Given that the WeDo motor is the same model that is built into the Bat Mobile, I would expect that the PoweredUp app would offer more functions for this motor if the motor was capable of them.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.