Skip to content

BrainRayChristensen/benni-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

Benni

Importing The Benni Library

  1. Download benni-debug.aar from this repo.
  2. In your project, go to the top, click file, click new and then click on New Module...

instruction image

  1. Scroll down, and click "Import .JAR/.AAR Package" and click next.
  2. 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.
  3. 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.

instruction image

  1. 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:

instruction image

  1. 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.

instruction image

  1. Build your project and you should now be able to use benni in your program! Happy coding!

Implementing The Code

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);

Robot Motion

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();

Robot Speech

Benni will say whatever you want, at least if it's english

String message = "Hello World!";
benni.say(message);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published