Package crackers.kobots.devices
Class DSLKt
-
- All Implemented Interfaces:
public final class DSLKt
-
-
Method Summary
Modifier and Type Method Description final static Unit
set(PwmOutputDevice $self, Boolean sensorValue)
Adds DSL-like capabilities to diozero
final static Unit
set(PwmOutputDevice $self, Float sensorValue)
final static Unit
set(DigitalOutputDevice $self, Boolean input)
final static Unit
set(ServoDevice $self, Float input)
Sets the value for the servo (-1 to 1). final static Unit
set(ServoDevice $self, Integer input)
final static Unit
set(LcdInterface<?> $self, Integer row, String text)
Uses array notion to set text on a rowExample: lcd[2] = "Hello, World"
final static Unit
setAngle(ServoDevice $self, Integer input)
final static Unit
at(ServoDevice $self, Float angle)
Sets the angle for the servo. final static Unit
at(ServoDevice $self, Integer angle)
final static Unit
at(MotorInterface $self, Float speed)
Run a motor at this relative speed (-1 to 1). final static Unit
position(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 Unit
plusAssign(LcdInterface<?> $self, String text)
Add text at current location final static Unit
plusAssign(LcdInterface<?> $self, Character char)
Add char at current location final static Unit
plusAssign(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
-
-
-
-