Skip to main content Skip to local navigation

Some useful things to do with Arduino, Firmata and Java

When contemplating how to use Firmata with Java, consider some of the following things:

  1. (first) install Firmata
  2. Using the OLED
  3. Registering Button Events
  4. Draw on your personal computer (with Princeton's StdLib)
  5. Graph Arduino Data with StdLib
  6. Pass Data between Java Objects

Your Main Project will look something like this (this is an older video that doesn't quite reflect changes to the updated project):

Install Firmata on your device

To do any of this you'll need to install Firmata:

Using the OLED display

The Arduino board that you use in EECS 1021 has an OLED display. You can tap into it using the firmata4j library:

Register Button Events

Buttons are useful devices to work with in Firmata:

You'll need to have event-driven programming on your board. Buttons (and other digital devices) create nice events:

Take Data from the Board and Graph it.

To do that you'll need a drawing library. You can use more complicated libraries like jFreeChart, but simpler libraries like the Princeton Standard Library will do:

Once you're familiar with StdLib, you can use it with Firmata and your Arduino board:

and then you can graph data pairs:

Data Passing Between Objects

One of the stumbling blocks that people run into when creating objects is how to pass data between them. This can be really handy with your projects. So have a look at this video:

https://youtu.be/fslS3ll1OhY (Part 1 / 2)

and then this video (Part 2/2)