Package crackers.kobots.devices
Class DSLKt
-
- All Implemented Interfaces:
public final class DSLKt
-
-
Method Summary
Modifier and Type Method Description final static Unitset(PwmOutputDevice $self, Boolean sensorValue)Adds DSL-like capabilities to diozerofinal static Unitset(PwmOutputDevice $self, Float sensorValue)final static Unitset(DigitalOutputDevice $self, Boolean input)final static Unitset(ServoDevice $self, Float input)Sets the value for the servo (-1 to 1). final static Unitset(ServoDevice $self, Integer input)final static Unitset(LcdInterface<?> $self, Integer row, String text)Uses array notion to set text on a rowExample: lcd[2] = "Hello, World"final static UnitsetAngle(ServoDevice $self, Integer input)final static Unitat(ServoDevice $self, Float angle)Sets the angle for the servo. final static Unitat(ServoDevice $self, Integer angle)final static Unitat(MotorInterface $self, Float speed)Run a motor at this relative speed (-1 to 1). final static Unitposition(LcdInterface<?> $self, Pair<Integer, Integer> location)Use a Pair to express row, columnExample: lcd position Pair(1,1)TODO not happy about this onefinal static UnitplusAssign(LcdInterface<?> $self, String text)Add text at current location final static UnitplusAssign(LcdInterface<?> $self, Character char)Add char at current location final static UnitplusAssign(LcdInterface<?> $self, Integer special)Add a special code at current location -
-
Method Detail
-
set
final static Unit set(PwmOutputDevice $self, Boolean sensorValue)
Adds DSL-like capabilities to
diozero
-
set
final static Unit set(LcdInterface<?> $self, Integer row, String text)
Uses array notion to set text on a row
Example:
lcd[2] = "Hello, World"
-
at
final static Unit at(ServoDevice $self, Float angle)
Sets the angle for the servo. Note that this must be in the range the servo supports.
-
at
final static Unit at(MotorInterface $self, Float speed)
Run a motor at this relative speed (-1 to 1).
-
position
final static Unit position(LcdInterface<?> $self, Pair<Integer, Integer> location)
Use a Pair to express row, column
Example:
lcd position Pair(1,1)TODO not happy about this one
-
plusAssign
final static Unit plusAssign(LcdInterface<?> $self, String text)
Add text at current location
-
plusAssign
final static Unit plusAssign(LcdInterface<?> $self, Character char)
Add char at current location
-
plusAssign
final static Unit plusAssign(LcdInterface<?> $self, Integer special)
Add a special code at current location
-
-
-
-