Lego WeDo 4 Java

Just for the sake of indexation and for the only purpose of sharing almost a week of reverse engineering, I’m writing this post about a small project which allows you to interact with Lego WEDO Kits Motors and Sensors using Java. When I’ve started with the Rolo The Robot project, I’ve first look into the Lego WeDo kits, because they looked simple and modular. After finding out their limitations, I’ve decided to at least write a small lib in java to interact with those motors and sensors. Based on Ian Daniher’s WeDoMore project for Python, I’ve did a similar version in Java. The Java version allows you to read the sensors and interact with the motors at the same time, which I believe that it was a limitation from the Python version of the library.

This lib is in a very initial but usable version, and I don’t see too many reasons to continue improving it, but I know that it can be very helpful for people which is looking forward to create simple applications for educational purposes. In order to use it you will need to have the following items:

http://www.active-robots.com/legor-wedotm-robotics-usb-hub.html

As you can see it is not a cheap thing to buy, but if you have a couple of those, you can build a small robot with two motors and two sensors, which for kids this could be very handy.

I’ve provided support for Distance and Tilt sensor as well as for the Medium Motor.

Medium Lego Motor: http://shop.lego.com/en-GB/LEGO-Power-Functions-M-Motor-8883

Motion/Distance Sensor: http://www.active-robots.com/legor-wedotm-robotics-motion-sensor.html

Tilt Sensor: http://www.active-robots.com/legor-wedotm-robotics-tilt-sensor.html

Feel free to fork the project  and drop me a line if you are interested in using the project, I can quickly extend it for your particular needs if its necessary. All the source code is under the Apache License V2, so there is no restriction to use it or distribute it. You can find all the source code here: https://github.com/Salaboy/lego-wedo4j.git

About these ads
Tagged , , , , , , , ,

2 thoughts on “Lego WeDo 4 Java

  1. infchem says:

    Hey Salaboy,

    i did nearly the same in August ’12. With the codeminders hid api I wrote a mod to control the Lego Wedo in Minecraft.
    While I sniffed the usb traffic, I saw that you I can use the motors as a rotation sensor, in both directions. Maybe that’s interesting for you?
    Last week I adapted my work to the arduino leonardo, which can work as a hid device.

    I’m curious: Who is rolo the robot?

    Greetings,
    infchem

    • salaboy says:

      Hi infchem,
      First of all thanks a lot for your comment, I’m really happy to see that people is using Lego WeDo to do cool stuff.
      What you mention about using the motors as rotation sensors is more than interesting. Can you collaborate with the code for doing that? All my code is Open Source and is hosted on github. If you have some links to your work I will take a look on that.

      You can read more about Rolo The Robot in my other post: http://salaboy.com/2012/12/29/rolo-the-robot-says-happy-new-year/

      Rolo is a Drools controlled robot, right now is working on battery and uses a Raspberry Pi and an Arduino Uno

      Cheers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 880 other followers

%d bloggers like this: