Replace JPigpio, add hardware PWM support (#127)

* Send brightness properly to clients

* Refactor GPIO, add custom Pigpio socket wrapper

* Replace PiGPIO with PigpioPin, fix hardwarePWM

* Remove Jpigpio dependency

* Apply Spotless

* Warn user of Pigpio pin incapable of hardware PWM

* Begin rework of blinking and brightness control for vision leds

* Fixed blink, fixed brightness persistence, added bootup blink

* Cleanup HardwareManager access of config

* Apply spotless

* Skip hardware test on non-Pi

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
This commit is contained in:
Banks T
2020-10-16 19:06:40 -04:00
committed by GitHub
parent 23f3c0e6e1
commit e37fcdea98
19 changed files with 1172 additions and 328 deletions

View File

@@ -22,19 +22,6 @@ import org.apache.commons.math3.util.FastMath;
public class MathUtils {
MathUtils() {}
public static double sigmoid(Number x) {
double bias = 0;
double a = 5;
double b = -0.05;
double k = 200;
if (x.doubleValue() < 50) {
bias = -1.338;
}
return ((k / (1 + Math.pow(Math.E, (a + (b * x.doubleValue()))))) + bias);
}
public static double toSlope(Number angle) {
return FastMath.atan(FastMath.toRadians(angle.doubleValue() - 90));
}