You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
brice-morin edited this page May 2, 2011
·
3 revisions
This page briefly describes the JArduino API. At least, it presents the classes you will have to interact with.
Enumerations
JArduino provides enumerations to properly access pins, modes, etc. For example, if you need to refer to PIN12, use
DigitalPinmyPin = DigitalPin.PIN_12;
(Abstract)JArduino
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.