RoboJDETM v2.0

com.ridgesoft.intellibrain
Class IntelliBrain

java.lang.Object
  extended by com.ridgesoft.intellibrain.IntelliBrain

public class IntelliBrain
extends Object

This class serves as the main point of access to features of the IntelliBrain robotics controller.

IntelliBrain and IntelliBrain 2 robotics controllers are based on the Atmel ATmega128 microcontroller. On the IntelliBrain 2 robotics controller, the ATmega128 ports are used as follows:

Port A

Port B

Port C

Port D

Port E

Port F

Port G

On the IntelliBrain robotics controller, the ATmega128 ports are used as follows:

Port A

Port B

Port C

Port D

Port E

Port F

Port G


Field Summary
static int MODEL_IntelliBrain
           
static int MODEL_IntelliBrain_2
           
 
Method Summary
static IntelliBrainAnalogInput getAnalogInput(int portNumber)
          Gets the IntelliBrainAnalogInput object for the specified input port.
static DigitalInput getBatteryInput()
          Gets the IntelliBrain controller battery digital input.
static Speaker getBuzzer()
          Gets the Speaker object for the buzzer.
static SerialPort getCom1()
          Gets the SerialPort object for COM1.
static SerialPort getCom2()
          Gets the SerialPort object for COM2.
static EEPROM getCpuEEPROM()
          Gets the EEPROM object for the CPU EEPROM.
static IntelliBrainDigitalIO getDigitalIO(int portNumber)
          Gets the IntelliBrainDigitalIO object for the specified digital port.
static EEPROM getExpansionEEPROM()
          Gets the EEPROM object for the expansion board EEPROM.
static LED getFaultLed()
          Gets the LED object for the fault LED (red) on the main board.
static I2CMaster getI2CMaster()
          Gets the I2CMaster object for the I2C bus.
static LED getIrLed()
          Gets the LED object for the infrared LED on the IntelliBrain 2 controller or the expansion board on the original IntelliBrain controller.
static IntelliBrainIrReceiver getIrReceiver()
          Gets the IrRreceiver object for the infrared receiver on the main board.
static Display getLcdDisplay()
          Gets the Display object for the LCD.
static int getModel()
          Gets the model number of the IntelliBrain controller.
static Motor2 getMotor(int motor)
          Gets the motor object for a particular motor.
static OutputStream getOutputStream()
          Gets the OutputStream for the LCD.
static Servo getServo(int servo)
          Gets the Servo object for the specified servo.
static IntelliBrainShaftEncoder getShaftEncoder(int encoder)
          Gets the IntelliBrainShaftEncoder object for a particular quadrature shaft encoder.
static PushButton getStartButton()
          Gets the PushButton object for the START button.
static LED getStatusLed()
          Gets the LED object for the status LED (green) on the main board.
static PushButton getStopButton()
          Gets the PushButton object for the STOP button.
static AnalogInput getThumbWheel()
          Gets the AnalogInput object for the thumbwheel.
static LED getUserLed(int ledNumber)
          Gets the LED object for the specified LED on the IntelliBrain 2 board or the expansion board on the original IntelliBrain controller.
static boolean isExpansionBoardPresent()
          Indicates if the IntelliBrain expansion board is present.
static void setTerminateOnStop(boolean terminateOnStop)
          Configures whether the virtual machine terminates the program when the STOP button is pressed.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Field Detail

MODEL_IntelliBrain

public static final int MODEL_IntelliBrain
See Also:
Constant Field Values

MODEL_IntelliBrain_2

public static final int MODEL_IntelliBrain_2
See Also:
Constant Field Values
Method Detail

getAnalogInput

public static IntelliBrainAnalogInput getAnalogInput(int portNumber)
Gets the IntelliBrainAnalogInput object for the specified input port.

An analog input port may alternatively be used as a digital input.

Analog port 3 is used to multiplex the expansion analog ports, therefore, it cannot be used directly if the expansion board is present.

Analog ports 1, 2 on the main board and 8 - 11 on the expansion board have a .1uF capacitor attached for noise reduction.

Analog ports 12 - 15 on the expansion board allow the software selectable pull-up on analog port 3 (multiplexing port) to be enabled while sampling. The pull-up is only enabled while the port is being sampled, so it will only be useful for inputs that have very low capacitance. The software pull-up is not supported on ports 8 - 11 because of the capacitors installed on those port.

Parameters:
portNumber - the number of the analog port
Returns:
IntelliBrainAnalogInput object for the port

getBatteryInput

public static DigitalInput getBatteryInput()
Gets the IntelliBrain controller battery digital input. This is not supported on the IntelliBrain 2 controller.

The input will return true if the battery is meeting the current power demands and false otherwise.

The J2 jumper (under the LCD) must be inserted to connect the low battery indicator to the IO3 port. When J2 is inserted, IO3 must not be used as a sensor input.

Returns:
DigitalInput for low battery indication

getBuzzer

public static Speaker getBuzzer()
Gets the Speaker object for the buzzer.

The IntelliBrain buzzer can play frequencies in the range of 120 Hz to 9.3 kHz. The granularity of steps between tones that can be played increases with frequency and is about 2 kHz at the highest frequencies.

Returns:
Speaker object for the buzzer

getCom1

public static SerialPort getCom1()
Gets the SerialPort object for COM1.

This method will cause communication between the virtual machine and the host computer to be disabled, giving your program exclusive access to the COM1 port.

Returns:
SerialPort object for COM1.

getCom2

public static SerialPort getCom2()
Gets the SerialPort object for COM2.

Returns:
SerialPort object for COM2.

getCpuEEPROM

public static EEPROM getCpuEEPROM()
Gets the EEPROM object for the CPU EEPROM.

This CPU EEPROM provides 4000 bytes of persistent storage.

Note: 96 bytes of EEPROM are reserved for internal use and are not accessible to applications. This leaves 4000 bytes for applications.

Returns:
EEPROM object for the CPU EEPROM

getDigitalIO

public static IntelliBrainDigitalIO getDigitalIO(int portNumber)
Gets the IntelliBrainDigitalIO object for the specified digital port.

The port is configured as an input by default.

Pulse input measurement is supported on ports 3 through 6.

Parameters:
portNumber - the number of the digital port
Returns:
IntelliBrainDigitalIO object for the port

getExpansionEEPROM

public static EEPROM getExpansionEEPROM()
Gets the EEPROM object for the expansion board EEPROM.

The expansion board EEPROM provides 64K bytes of storage.

Returns:
EEPROM object for the expansion board EEPROM

getFaultLed

public static LED getFaultLed()
Gets the LED object for the fault LED (red) on the main board.

Returns:
LED object for the red LED

getI2CMaster

public static I2CMaster getI2CMaster()
Gets the I2CMaster object for the I2C bus.

The I2CMaster object provides the interface to communicate with devices attached to any I2C port.

Returns:
I2CMaster object for I2C bus.

getIrLed

public static LED getIrLed()
Gets the LED object for the infrared LED on the IntelliBrain 2 controller or the expansion board on the original IntelliBrain controller.

This LED is modulated at 38 kHz. When it is set to on, it toggles on and off at 38 kHz.

Returns:
LED object for the IR LED

getIrReceiver

public static IntelliBrainIrReceiver getIrReceiver()
Gets the IrRreceiver object for the infrared receiver on the main board.

Returns:
IrReceiver object

getLcdDisplay

public static Display getLcdDisplay()
Gets the Display object for the LCD.

The Display object may be used to print to a specific line or character position. Alternatively, the getOutputStream method can be used to print scrolling text to the LCD.

Returns:
Display object

getModel

public static int getModel()
Gets the model number of the IntelliBrain controller.

Returns:
model number

getMotor

public static Motor2 getMotor(int motor)
Gets the motor object for a particular motor.

Parameters:
motor - number of the motor (1 - 4)
Returns:
Motor2 object

getOutputStream

public static OutputStream getOutputStream()
Gets the OutputStream for the LCD.

This can be used in conjuntion with a PrintStream object to print scrolling output to the LCD.

The LCD can be addressed in line and character mode by using the getLcdDisplay method.

Returns:
OutputStream object

getServo

public static Servo getServo(int servo)
Gets the Servo object for the specified servo.

Parameters:
servo - number of the sero (1 - 8).
  • IntelliBrain 2: 1 - 8
  • IntelliBrain main board: 1 - 2
  • IntelliBrain expansion board: 3 - 8
Returns:
Servo object

getShaftEncoder

public static IntelliBrainShaftEncoder getShaftEncoder(int encoder)
Gets the IntelliBrainShaftEncoder object for a particular quadrature shaft encoder.

Each shaft encoder uses a pair of digital inputs to implement a quadrature shaft encoder. The two pins should be connected to two digital sensors that generate a quadrature signal. The two sensors should be 90 degrees out of phase. If the counter counts in the opposite direction of what is expected, swap the two inputs.

Shaft encoders on the IntelliBrain robotics controller are sampled once per millisecond. Therefore, the maximum counting rate which is supported is 1000 counts per second.

On the IntelliBrain robotics controller, the encoder rate value is updated every 128 milliseconds. The maximum value the getRate method can return is 7.

Parameters:
encoder - number of the encoder (1 to 4)

getStartButton

public static PushButton getStartButton()
Gets the PushButton object for the START button.

Returns:
PushButton object for the START button

getStatusLed

public static LED getStatusLed()
Gets the LED object for the status LED (green) on the main board.

Returns:
LED object for the green LED

getStopButton

public static PushButton getStopButton()
Gets the PushButton object for the STOP button.

Returns:
PushButton object for the STOP button

getThumbWheel

public static AnalogInput getThumbWheel()
Gets the AnalogInput object for the thumbwheel.

Returns:
AnalogInput for the thumbwheel

getUserLed

public static LED getUserLed(int ledNumber)
Gets the LED object for the specified LED on the IntelliBrain 2 board or the expansion board on the original IntelliBrain controller.

By default the LEDs are motor status indicators.

Calling this method disconnects the LED from the motor control so it may be used for other purposes.

Parameters:
ledNumber - 1 through 4 on IntelliBrain 2, 1 through 8 on IntelliBrain expansion board, numbered left to right
Returns:
LED object for the specified LED

isExpansionBoardPresent

public static boolean isExpansionBoardPresent()
Indicates if the IntelliBrain expansion board is present. This method always returns false for the IntelliBrain 2, which does not support an expansion board.

Returns:
true if expansion board is present, otherwise false.

setTerminateOnStop

public static void setTerminateOnStop(boolean terminateOnStop)
Configures whether the virtual machine terminates the program when the STOP button is pressed.

The initial setting is true.

Parameters:
terminateOnStop - true if the program should terminate when the STOP button is pressed

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com