diff --git a/docs/Tutorial.html b/docs/Tutorial.html index 860f421..c3f6e0e 100644 --- a/docs/Tutorial.html +++ b/docs/Tutorial.html @@ -1972,7 +1972,7 @@

6.2.3. Anwendungsbeispiel

Console console = new Console(); console.promptForExit(); - GpioPinDigitalInput pin = gpio.provisionDigitalInputPin(RaspiBcmPin.GPIO_17); + GpioPinDigitalInput pin = gpio.provisionDigitalInputPin(RaspiBcmPin.GPIO_25); ButtonComponent button = new ButtonComponent(pin); boolean lastStatePressed = false; @@ -2107,7 +2107,7 @@

6.3.3. Anwendungsbeispiel

Console console = new Console(); console.promptForExit(); - GpioPinPwmOutput pwm = gpio.provisionPwmOutputPin(RaspiBcmPin.GPIO_12); + GpioPinPwmOutput pwm = gpio.provisionPwmOutputPin(RaspiBcmPin.GPIO_18); BuzzerComponent buzzer = new BuzzerComponent(pwm); Note notes[] = { Note.G4, Note.G4, Note.G4, Note.DS4, Note.AS4, Note.G4, Note.DS4, Note.AS4, Note.G4, Note.D5, @@ -2535,7 +2535,15 @@

6.7.2. API

UltraSonicRangerComponent​(GroveAdapter groveAdapter)

-

Standard Constructor for the Ultra Sonic Ranger that only needs grove hat connection information.

+

Standard Constructor for the Grove Ultra Sonic Ranger that only needs grove hat connection information.

+ + +

UltraSonicRangerComponent​(Pin pin)

+

Constructor for the Ultrasonic Ranger that uses the same pin for the trigger and the echo

+ + +

UltraSonicRangerComponent​(Pin trigger, Pin echo)

+

Constructor for using the Grove Ultrasonic Ranger without the Grove Base Hat. This is also compatible with other Ultrasonic Rangers that use different pins for the trigger and the echo

@@ -2572,7 +2580,14 @@

6.7.3. Anwendungsbeispiel

-
            UltraSonicRangerComponent ultraSonicRangerComponent = new UltraSonicRangerComponent(GroveAdapter.D5);
+
            GpioFactory.setDefaultProvider(new RaspiGpioProvider(RaspiPinNumberingScheme.BROADCOM_PIN_NUMBERING));
+            final GpioController gpio = GpioFactory.getInstance();
+
+            //Ultrasonic Ranger on the CrowPi
+            GpioPinDigitalInput echo = gpio.provisionDigitalInputPin(RaspiBcmPin.GPIO_12);
+            GpioPinDigitalInput trigger = gpio.provisionDigitalInputPin(RaspiBcmPin.GPIO_16);
+
+            UltraSonicRangerComponent ultraSonicRangerComponent = new UltraSonicRangerComponent(trigger, echo);
 
             //Shows the measured distance every second
             while (true) {
@@ -3805,7 +3820,7 @@ 

7.2.3. Codierung

.height(1080) .encoding(Encoding.JPEG) .quality(85) - .rotation(180); + .rotation(0); raspberryPiCamera = new RaspberryPiCameraComponent(stillConfig); }
@@ -3816,6 +3831,7 @@

7.2.3. Codierung

    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);
@@ -4424,7 +4440,7 @@

8.6.2. Echo messen

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 @@

8.6.2. Echo messen

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 @@

Literaturverzeichnis