Package ch.hevs.kart
Enum Class KartSequence.Instruction.OpCode
- All Implemented Interfaces:
Serializable
,Comparable<KartSequence.Instruction.OpCode>
,Constable
- Enclosing class:
KartSequence.Instruction
Enumerates the opcodes actually supported by the Kart's sequencer vm.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTurn the LEDs off according to the given mask.Set digital output port to the passed value (4 lsb ar considered).End of the sequence (Added by the builder automatically) and stops the sequence.Go to a given index in the sequence.Modifies the register according to the given sub-opcode and and operand.NOP.Wait for the passed amount of hall pulses on hall sensor 1.Wait for the passed amount of milliseconds before executing the next instruction.Set the steering position.Turn the LEDs on according to the given mask.Set the speed of the drive subsystem. -
Method Summary
Modifier and TypeMethodDescriptionbyte
toByte()
Converts the opcode to a byte that can be interpreted by the kart VM.Returns the enum constant of this class with the specified name.static KartSequence.Instruction.OpCode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NOP
NOP. Probably not used that often...
-
SET_SPEED
Set the speed of the drive subsystem.
-
SET_ANGLE
Set the steering position.
-
DRIVE_LEDS
Set digital output port to the passed value (4 lsb ar considered).
-
SET_LED
Turn the LEDs on according to the given mask.
-
CLEAR_LED
Turn the LEDs off according to the given mask.
-
RUN_DISTANCE
Wait for the passed amount of hall pulses on hall sensor 1.
-
RUN_FOR
Wait for the passed amount of milliseconds before executing the next instruction.
-
MODIFY_REGISTER
Modifies the register according to the given sub-opcode and and operand.
-
GOTO_IF_REG_NZ
Go to a given index in the sequence.
-
END
End of the sequence (Added by the builder automatically) and stops the sequence.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toByte
public byte toByte()Converts the opcode to a byte that can be interpreted by the kart VM.
- Returns:
- Raw opcode.
-