This library simplifies Tinkerforge's sensor API. It Removes the pain of sensor UIDs, sensor versions, ports and provides a generic API for every sensor.
- Install Brick Daemon
- Install and open IntelliJ (IDE / EDITOR)
- Install Java via IntelliJ: File -> Project Structure -> SDKs ->
+
Download JDK ->AdoptOpenJdk
-> Version11
- Compile / Initialize Project: Right click on
tinkerforge-senor
-> Maven ->Reload Project
andGenerate Sources
- A list of all supported Sensors (Bricks/Bricklets): Sensors
final Stack stack = new Stack();
stack.addListener(this::listen).connect();
boolean ledStatusToggle = true;
private void listen(final SensorEvent event) {
if (event.isValueType().buttonPressed() ) {
ledStatusToggle = !ledStatusToggle;
if (ledStatusToggle) {
sensor.setStatusLedOn();
stack.get().buttonRGBList().forEach(button -> button.setColor(Color.GREEN));
} else {
sensor.setStatusLedOff();
stack.get().buttonRGBList().forEach(button -> button.setColor(Color.RED));
}
}
}
- Handle Authentication
- Handle connection errors (currently slows API down)
- Import Sensors from v0.0.6
- 16IO manage also input
- Spring integration