Examples

Some arduino java examples useful if you want to write your own custom programs.

Let me know if you'd like more annotation and description.

To run the examples:

  1. Upload the sketch to the Arduino
  2. Compile the source by typing: javac *.java into terminal in the same directory as the source code.
  3. Run the program using java Program01 (for first example)

Note: you will need java JDK and the rxtx library as detailed in the how to compile java programs from source tutorial above.

Example 01 - Reading integer data from the Arduino and conversion to a useful form with output to terminal.

Example 02 - Reading doubles from the Arduino with output to terminal.

Example 03 - Adding a java frame with a read out of the values read in from the Arduino.

Example 04 - Adding buttons to the java frame that send data to the Arduino when pressed.

Example 05 - Split string input