private void waitForButtonPress() throws InterruptedException {
+ lcd.clearText();
lcd.displayText("Press Button", 1);
lcd.displayText("To Start!", 2);
Thread.sleep(1000);
@@ -3958,7 +3974,7 @@ 8.1.1. Status modifizieren
if (dimmable) {
setBrightness(0);
} else {
- pin.high();
+ pin.low();
}
ComponentLogger.logInfo("LedComponent: LED turned off");
@@ -4404,12 +4420,12 @@ 8.6.1. Trigger Signal
ComponentLogger.logInfo("UltraSonicRangerComponent: Trigger to measure distance");
- Gpio.pinMode(pin, Gpio.OUTPUT);
- Gpio.digitalWrite(pin, false);
+ Gpio.pinMode(triggerPin, Gpio.OUTPUT);
+ Gpio.digitalWrite(triggerPin, false);
Thread.sleep(0, 2000);
- Gpio.digitalWrite(pin, true);
+ Gpio.digitalWrite(triggerPin, true);
Thread.sleep(0, 10000);
- Gpio.digitalWrite(pin, false);
+ Gpio.digitalWrite(triggerPin, false);
int TIMEOUT = 1000000; //just a large number to avoid an endless loop when there is a device problem
//wait for the pulse to start (ultra sonic wave sent)
- while (count < TIMEOUT && Gpio.digitalRead(pin) == 0)
+ while (count < TIMEOUT && Gpio.digitalRead(echoPin) == 0)
count++;
if (count >= TIMEOUT) return 0;
@@ -4432,7 +4448,7 @@
count = 0;
//wait for the pulse to end (ultra sonic wave received)
- while (count < TIMEOUT && Gpio.digitalRead(pin) == 1)
+ while (count < TIMEOUT && Gpio.digitalRead(echoPin) == 1)
count++;
if (count >= TIMEOUT) return 0;
long t2 = microTime();
@@ -5729,7 +5745,7 @@