- Download benni-debug.aar from this repo.
- In your project, go to the top, click file, click new and then click on New Module...
- Scroll down, and click "Import .JAR/.AAR Package" and click next.
- Input the file path for where your downloaded benni-debug.aar and click finish.
There should now be a benni-debug module in your project. - In order for your app to use the Benni library, you must import it into the module. This is done by right clicking on the module you want to use it in (most likely app) and clicking on open module settings then opening the dependencies tab and adding a module dependency for benni-debug.
- Because the module depends on other libraries, the module that uses Benni must import those libraries. Open your top level build.gradle and add
maven { url "https://jitpack.io" }
inside the allprojects and repositories section. It should look something like this:
- Next, open the
build.gradle
file in the module you want to use benni in and add
implementation 'com.github.felHR85:UsbSerial:4.5.2'
to the list of dependencies.
- Build your project and you should now be able to use benni in your program! Happy coding!
Before any of the other commands are implemented, add these lines to the onCreate() method of your startup activity
UsbManager usbManager = (UsbManager) getSystemService(USB_SERVICE);
Benni benni = new Benni();
benni.init(this, usbManager);
Benni will move in the direction you tell it to until you tell it to stop
benni.moveForward();
benni.moveBackwards();
benni.moveLeft();
benni.moveRight();
benni.stopMovement();
Benni will say whatever you want, at least if it's english
String message = "Hello World!";
benni.say(message);