Class LocalEV3

  • All Implemented Interfaces:
    Brick, EV3

    public class LocalEV3
    extends java.lang.Object
    implements EV3
    This class represents the local instance of an EV3 device. It can be used to obtain access to the various system resources (Sensors, Motors etc.).
    Author:
    andy
    • Field Detail

      • lcdManager

        protected lejos.internal.ev3.EV3LCDManager lcdManager
      • battery

        protected final Power battery
      • audio

        protected final Audio audio
      • ports

        protected java.util.ArrayList<lejos.internal.ev3.EV3Port> ports
      • textLCD

        protected TextLCD textLCD
      • keys

        protected lejos.internal.ev3.EV3Keys keys
      • led

        protected final LED led
      • video

        protected Video video
      • enter

        protected final Key enter
      • escape

        protected final Key escape
      • left

        protected final Key left
      • right

        protected final Key right
      • up

        protected final Key up
      • down

        protected final Key down
      • keyArray

        protected final Key[] keyArray
    • Method Detail

      • get

        public static EV3 get()
      • getPort

        public Port getPort​(java.lang.String portName)
        Return a port object for the request port name. This allows access to the hardware associated with the specified port.
        Specified by:
        getPort in interface Brick
        Parameters:
        portName - The name of port
        Returns:
        the request port
      • getPower

        public Power getPower()
        return a battery object which can be used to obtain battery voltage etc.
        Specified by:
        getPower in interface Brick
        Returns:
        A battery object
      • initLCD

        protected void initLCD()
      • getTextLCD

        public TextLCD getTextLCD()
        Description copied from interface: Brick
        Get text access to the LCD using the default font
        Specified by:
        getTextLCD in interface Brick
        Returns:
        the text LCD
      • getGraphicsLCD

        public GraphicsLCD getGraphicsLCD()
        Description copied from interface: Brick
        Get graphics access to the LCD
        Specified by:
        getGraphicsLCD in interface Brick
        Returns:
        the graphics LCD
      • getTextLCD

        public TextLCD getTextLCD​(Font f)
        Description copied from interface: Brick
        Get text access to the LCD using a specified font
        Specified by:
        getTextLCD in interface Brick
        Parameters:
        f - the font
        Returns:
        the text LCD
      • getAudio

        public Audio getAudio()
        return a Audio object which can be used to access the device's audio playback
        Specified by:
        getAudio in interface Brick
        Returns:
        A Audio device
      • isLocal

        public boolean isLocal()
        Description copied from interface: Brick
        Test whether the brick is a local one
        Specified by:
        isLocal in interface Brick
        Returns:
        true iff brick is local
      • getType

        public java.lang.String getType()
        Description copied from interface: Brick
        Get the type of brick, e.g. "EV3", "NXT", "BrickPi"
        Specified by:
        getType in interface Brick
        Returns:
        the brick type
      • getName

        public java.lang.String getName()
        Description copied from interface: Brick
        Get he name of the brick
        Specified by:
        getName in interface Brick
        Returns:
        the name
      • getBluetoothDevice

        public LocalBTDevice getBluetoothDevice()
        Description copied from interface: Brick
        Get the local Bluetooth device
        Specified by:
        getBluetoothDevice in interface Brick
        Returns:
        the local Bluetooth device
      • getWifiDevice

        public LocalWifiDevice getWifiDevice()
        Description copied from interface: Brick
        Get the local Wifi device
        Specified by:
        getWifiDevice in interface Brick
        Returns:
        the local Wifi device
      • setDefault

        public void setDefault()
        Description copied from interface: Brick
        Set this brick as the default one for static methods
        Specified by:
        setDefault in interface Brick
      • getKey

        public Key getKey​(java.lang.String name)
        Description copied from interface: Brick
        Get access to a specific Key (aka Button)
        Specified by:
        getKey in interface Brick
        Parameters:
        name - the key name
        Returns:
        an implementation of the Key interface
      • getLED

        public LED getLED()
        Description copied from interface: Brick
        Get access to the LED
        Specified by:
        getLED in interface Brick
        Returns:
        an implementation of the LED interface
      • getKeys

        public Keys getKeys()
        Description copied from interface: Brick
        Get access to the keys (buttons)
        Specified by:
        getKeys in interface Brick
        Returns:
        an implementation of the Keys interface