-
Notifications
You must be signed in to change notification settings - Fork 63
JArduino API
This page briefly describes the JArduino API. At least, it presents the classes you will have to interact with.
JArduino provides enumerations to properly access pins, modes, etc. For example, if you need to refer to PIN12, use
DigitalPin myPin = DigitalPin.PIN_12;
JArduino and AbstractJarduino provide all the methods that wraps the Arduino library. You should extend JArduino to properly use the JArduino framework.
For example, just call
this.pinMode(DigitalPin.PIN_12, PinMode.OUTPUT);
to set PIN12 as an output pin.
Using the enumeration, you can only set existing pins with exiting modes. In Arduino you would have to rely on integers... which would allow you to set non-existing pins with non-existing modes, like this:
pinMode(666, 667);
which is totally evil: this will compile, but I do not dare uploading this code on my Arduino board... In other words, JArduino is safer and provides better guidance to developpers.
TODO