JArduino

Whipped cream to go :wink:

The Arduino can comunicate with the computer in several ways. Right now we have support for Serial, xBee and bluethoot.
To get started you load a special scetch to your Arduino board. This scetch will now handle all communication with the computer and you can tell your board to do almoast anything.
For exampel to do some LED blinking you can write this program:

import org.sintef.jarduino.DigitalPin;
import org.sintef.jarduino.DigitalState;
import org.sintef.jarduino.JArduino;
import org.sintef.jarduino.PinMode;
import org.sintef.jarduino.comm.Serial4JArduino;
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
 */

public class Blink extends JArduino {

    public Blink(String port) {
        super(port);
    }

    @Override
    protected void setup() {
        // initialize the digital pin as an output.
        // Pin 13 has an LED connected on most Arduino boards:
        pinMode(DigitalPin.PIN_13, PinMode.OUTPUT);
    }

    @Override
    protected void loop() {
        // set the LED on
        digitalWrite(DigitalPin.PIN_13, DigitalState.HIGH);
        delay(1000); // wait for a second
        // set the LED off
        digitalWrite(DigitalPin.PIN_13, DigitalState.LOW);
        delay(1000); // wait for a second
    }

    public static void main(String[] args) {
        String serialPort;
        if (args.length == 1) {
            serialPort = args[0];
        } else {
            serialPort = Serial4JArduino.selectSerialPort();//Serial chooser interface
        }
        JArduino arduino = new Blink(serialPort);
        arduino.runArduinoProcess();
    }
}

This is absolutely more code then what you must write in the native Arduino language. BUT, the advantage is that now everything that you can get input from in java can manipulate your Arduino board.

The main limit in using JArduino is that the Arduino board have to be able to communicate with a computer, or else the Arduino board wouldn't know what to do :wink:

Some screenshoots follow
You can click on a pin and then select what you want to do on that pin. Different pins have different attributes, e.g. AnalogPin, DigitalPin, InterruptPin etc.

On the left side you get a program flow as you select action to perform, you can also add controll sequenses in this flow.
These controll sequences requires that you have don at least one analogRead or digitalRead

Here you can see all the options you can do on DigitalPin_3 which is also a PWMPin and a interruptPin.
On the right side you can do writes to, and reads from the EEPROM memory.

There is also possible to generate code, both for JArduino and for Arduino:

Tell me if you want more cream for our delicious cake;)
PS, some guys on the team are french.... but I don't think they are much into gardening. :wink: