Skip to content

This Library is simplifying the API usage in a pure Java 8 way without any Frameworks. Removes pain of the Sensor UID, how to speak to the sensor and what values can i get from it etc. so that the focus is more on the logic

License

Notifications You must be signed in to change notification settings

YunaBraska/tinkerforge-sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinkerforge-sensor

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.

Build Maintainable Coverage Issues Commit Dependencies License Central Tag Javadoc Size Label Label

Requirements

  • Install Brick Daemon
  • Install and open IntelliJ (IDE / EDITOR)
  • Install Java via IntelliJ: File -> Project Structure -> SDKs -> + Download JDK -> AdoptOpenJdk -> Version 11
  • Compile / Initialize Project: Right click on tinkerforge-senor -> Maven -> Reload Project and Generate Sources

Sensor documentation

  • A list of all supported Sensors (Bricks/Bricklets): Sensors

Example

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));
        }
    }
}

TODO

  • Handle Authentication
  • Handle connection errors (currently slows API down)
  • Import Sensors from v0.0.6
  • 16IO manage also input
  • Spring integration

About

This Library is simplifying the API usage in a pure Java 8 way without any Frameworks. Removes pain of the Sensor UID, how to speak to the sensor and what values can i get from it etc. so that the focus is more on the logic

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages