A Java library to control an i-Buddy (a 3-inch tall blinking and moving USB figureine, see http://www.i-buddy.com/ ). Currently it is only supported / tested under Windows.
First of all you need to install libusb-win32. Follow the instructions there: http://libusb-win32.sourceforge.net/#installation .
<repository>
<id>JRAF.org</id>
<name>JRAF.org Maven Repository</name>
<url>http://www.JRAF.org/static/maven/2</url>
<layout>default</layout>
</repository>
<dependency>
<groupId>org.jraf</groupId>
<artifactId>jlibibuddy</artifactId>
<version>1.1</version>
<scope>compile</scope>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>install-libusbjava-dll</id>
<phase>install</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>libusbjava</groupId>
<artifactId>libusbjava-native-win32</artifactId>
<version>0.2.3.0</version>
<type>dll</type>
</artifactItem>
</artifactItems>
<outputDirectory>c:\windows\system32\</outputDirectory>
<destFileName>LibusbJava2.dll</destFileName>
</configuration>
</execution>
</executions>
</plugin>
This will copy the dll to the proper place when you invoke the install goal. Sorry I don't know if there is a way to do that in JLibIBuddy's pom directly so for now you have to do it in your own pom.
Using the library is very simple as shown by this example:
import org.jraf.jlibibuddy.IBuddy;
import org.jraf.jlibibuddy.IBuddyException;
import org.jraf.jlibibuddy.IBuddyUtils;
(...)
// get the i-Buddy
IBuddy iBuddy = IBuddy.getIBuddy();
// send some low level commands directly
iBuddy.sendHeadColor(IBuddy.Color.RED);
iBuddy.sendHeart(true);
// use IBuddyUtils to send higher levels commands
IBuddyUtils.flap(iBuddy, 400, 7);
(...)
Most of the USB code was done following the code posted by "Tom" at http://cuntography.com/blog/?p=17 . Thanks!
Contact the author: BoD@JRAF.org .