public class Arduino
extends org.sintef.jarduino.JArduino
Constructor and Description |
---|
Arduino(java.lang.String portName)
standard constructor for the Arduino class
|
Modifier and Type | Method and Description |
---|---|
void |
close()
closes the device
|
java.lang.String |
getDeviceName()
returns the name of the device
|
java.lang.String |
getDeviceType()
returns the type of the device
|
java.lang.String |
getDeviceVersion()
returns the version of the device
|
static float |
getLibraryVersion()
closes the device
|
int |
getMotorCount()
returns the number of servo motors controlled by the Arduino
|
int |
getSensorRawValue(int theChannel)
returns the sensor value for the device on one channel.
|
int |
getSerialNumber()
returns the serial number of the device
|
void |
initialize() |
static void |
listLibraryVersion()
list the library version
|
protected void |
loop()
loop the device
|
static void |
main(java.lang.String[] args)
main function
|
void |
setDeviceName(java.lang.String deviceName)
sets the name of the device
|
void |
setDeviceType(java.lang.String deviceType)
sets the type of the device
|
void |
setDeviceVersion(java.lang.String deviceVersion)
sets the version of the device
|
void |
setLibraryVersion(float libVersion)
sets the library version
|
void |
setPosition(int channel,
double position)
sets the position of the controller
|
void |
setSerialNumber(int serialNumber)
sets the serial number of the device
|
protected void |
setup()
setup the device
|
delay, interrupt0, interrupt1, map, receiveInterruptNotification, runArduinoProcess, stopArduinoProcess
public Arduino(java.lang.String portName)
portName
- the usb portpublic void initialize()
public java.lang.String getDeviceName()
public void setDeviceName(java.lang.String deviceName)
deviceName
- the name of the devicepublic java.lang.String getDeviceType()
public void setDeviceType(java.lang.String deviceType)
deviceType
- the type of the devicepublic java.lang.String getDeviceVersion()
public void setDeviceVersion(java.lang.String deviceVersion)
deviceVersion
- the version of the devicepublic int getSerialNumber()
public void setSerialNumber(int serialNumber)
serialNumber
- the serial number of the devicepublic int getSensorRawValue(int theChannel)
theChannel
- index of the channelpublic int getMotorCount()
public void setPosition(int channel, double position)
channel
- index of the channelposition
- the position to setpublic void close()
public static float getLibraryVersion()
public void setLibraryVersion(float libVersion)
libVersion
- the versionpublic static void listLibraryVersion()
protected void setup()
setup
in class org.sintef.jarduino.JArduino
protected void loop()
loop
in class org.sintef.jarduino.JArduino
public static void main(java.lang.String[] args)
args
- the argumentsRH, 2017