|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.spot.sensorboard.EDemoBoard
public class EDemoBoard
This class reflects all of the functionality of the EDemoBoard to a SPOT application. The old methods bindServo() & bindToneGenerator() have been removed. Please now use "new Servo()" & "new ToneGenerator()" passing in the IOutputPin or IOPin that they should use. This is a facade class. All the real work is done in the EDemoController class.
Field Summary | |
---|---|
static int |
A0
A0 index for array returned by getScalarInputs() |
static int |
A1
A1 index for array returned by getScalarInputs() |
static int |
A2
A2 index for array returned by getScalarInputs() |
static int |
A3
A3 index for array returned by getScalarInputs() |
static int |
A4
A4 index for array returned by getScalarInputs() |
static int |
A5
A5 index for array returned by getScalarInputs() |
static int |
D0
D0 index for array returned by getIOPins() |
static int |
D1
D1 index for array returned by getIOPins() |
static int |
D2
D2 index for array returned by getIOPins() |
static int |
D3
D3 index for array returned by getIOPins() |
static int |
D4
D4 index for array returned by getIOPins() |
static int |
H0
H0 index for array returned by getOutputPins() |
static int |
H1
H1 index for array returned by getOutputPins() |
static int |
H2
H2 index for array returned by getOutputPins() |
static int |
H3
H3 index for array returned by getOutputPins() |
static int |
LED1
LED1 index for array returned by getLEDs() |
static int |
LED2
LED2 index for array returned by getLEDs() |
static int |
LED3
LED3 index for array returned by getLEDs() |
static int |
LED4
LED4 index for array returned by getLEDs() |
static int |
LED5
LED5 index for array returned by getLEDs() |
static int |
LED6
LED6 index for array returned by getLEDs() |
static int |
LED7
LED7 index for array returned by getLEDs() |
static int |
LED8
LED8 index for array returned by getLEDs() |
static String |
PART_ID
Identifier string for demoboard |
static int |
SERIAL_SPEED_1200
|
static int |
SERIAL_SPEED_19200
|
static int |
SERIAL_SPEED_2400
|
static int |
SERIAL_SPEED_28800
|
static int |
SERIAL_SPEED_38400
|
static int |
SERIAL_SPEED_4800
|
static int |
SERIAL_SPEED_9600
|
static int |
SW1
SW1 index for array returned by getSwitches() |
static int |
SW2
SW2 index for array returned by getSwitches() |
Method Summary | |
---|---|
void |
andRegister(int reg,
int val)
Perform an AND assignment to one of the registers in the Atmega88 controller. |
IAccelerometer3D |
getAccelerometer()
Method to return the built in accelerometer. |
IADT7411 |
getADC()
Method to get an object that corresponds to the ADC on the EDemoBoard. |
ITemperatureInput |
getADCTemperature()
Method to get internal temperature sensor on the ADC from the EDemoBoard. |
EDemoController |
getEDemoController()
Return the underlying controller used by this EDemoBoard. |
int[] |
getFirmwareVersion()
Get the major and minor version information from the firmware running on the EDemoBoard. |
static Properties |
getInitialProperties()
Get the correct set of properties for this board for its flash memory |
static EDemoBoard |
getInstance()
Return the global singleton for the EDemoBoard. |
IIOPin[] |
getIOPins()
Method to return an array of the built in bidirectional digital pins. |
ITriColorLED[] |
getLEDs()
Method that returns an array of all the built in LEDs. |
ILightSensor |
getLightSensor()
Method to return the built in light sensor object. |
IOutputPin[] |
getOutputPins()
Method to return an array of the built in high current output pins. |
Properties |
getProperties()
Get the properties of this board. |
int |
getPulse(IInputPin pin,
boolean dir,
int timeout)
Ask the controller for a measurement of an incoming pulse on some input pin. |
int |
getRegister(int reg)
Peek method for the atmega firmware. |
IScalarInput[] |
getScalarInputs()
Method to return an array of the built in analog input pins. |
ISwitch[] |
getSwitches()
Method to return an array of all the built in switches on the board. |
void |
initUART(int baud,
boolean two_stopbit)
Initialize the UART module, set the speed and select the number of stop bits. |
void |
orRegister(int reg,
int val)
Perform an OR assignment to one of the registers in the Atmega88 controller. |
byte |
receiveUART()
Get the next byte from the UART. |
void |
sendUART(byte val)
Send a byte over the UART. |
void |
setProperties(Properties p)
Set the properties of this board |
void |
setPWM(IOutputPin pin,
int duty)
Request the controller maintain a pwm signal on a gpio pin. |
void |
setRegister(int reg,
int val)
Poke method for the Atmega88 controller, allows user to set low level registers on the part. |
void |
startPulse(IOutputPin pin,
boolean dir,
int usec)
Ask the controller to issue a pulse on the indicated pin. |
int |
UARTAvailable()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SERIAL_SPEED_1200
public static final int SERIAL_SPEED_2400
public static final int SERIAL_SPEED_4800
public static final int SERIAL_SPEED_9600
public static final int SERIAL_SPEED_19200
public static final int SERIAL_SPEED_28800
public static final int SERIAL_SPEED_38400
public static final int SW1
public static final int SW2
public static final int D0
public static final int D1
public static final int D2
public static final int D3
public static final int D4
public static final int H0
public static final int H1
public static final int H2
public static final int H3
public static final int A0
public static final int A1
public static final int A2
public static final int A3
public static final int A4
public static final int A5
public static final int LED1
public static final int LED2
public static final int LED3
public static final int LED4
public static final int LED5
public static final int LED6
public static final int LED7
public static final int LED8
public static final String PART_ID
Method Detail |
---|
public static EDemoBoard getInstance()
public EDemoController getEDemoController()
public IADT7411 getADC()
public ITemperatureInput getADCTemperature()
getADCTemperature
in interface IDemoBoard
public ITriColorLED[] getLEDs()
getLEDs
in interface IDemoBoard
public ISwitch[] getSwitches()
getSwitches
in interface IDemoBoard
public ILightSensor getLightSensor()
getLightSensor
in interface IDemoBoard
public IAccelerometer3D getAccelerometer()
getAccelerometer
in interface IDemoBoard
public IIOPin[] getIOPins()
getIOPins
in interface IDemoBoard
public IOutputPin[] getOutputPins()
getOutputPins
in interface IDemoBoard
public IScalarInput[] getScalarInputs()
getScalarInputs
in interface IDemoBoard
public void setPWM(IOutputPin pin, int duty)
startPulse
method.
Note: that the pwm signal will stop during deep sleep and resume
when deep sleep is over.
pin
- output pin to send PWM signal toduty
- duty cycle out of 255 slicespublic void startPulse(IOutputPin pin, boolean dir, int usec)
pin
- output pin to issue pulse ondir
- direction of desired pulse: true = high, false = lowusec
- length of pulse in microseconds [1:65535]public int getPulse(IInputPin pin, boolean dir, int timeout)
pin
- input pin to measure pulse ondir
- direction of desired pulse: true = high, false = lowtimeout
- how many milliseconds to wait for start of pulse (set to 0 for no timeout)
public void initUART(int baud, boolean two_stopbit)
baud
- baud speed to set module to, supported speeds are 2400, 4800, 9600, 19200, 28800, 38400 and 57600two_stopbit
- set to true if you want the module setup to send 2 stop bitspublic void sendUART(byte val)
val
- the value to send over the uartpublic byte receiveUART() throws IOException
IOException
- there are no available bytes on the UARTpublic int UARTAvailable()
public static Properties getInitialProperties()
public Properties getProperties()
public void setProperties(Properties p) throws IOException
p
- The properties to set.
IOException
public int[] getFirmwareVersion()
public void setRegister(int reg, int val)
reg
- Register to set value of, use only those defined statically by Atmega[88].javaval
- value to setpublic void orRegister(int reg, int val)
reg
- register to set value ofval
- value to use in operationpublic void andRegister(int reg, int val)
reg
- register to set value ofval
- value to use in operationpublic int getRegister(int reg)
reg
- Register to read value from
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |