Skip to content

Commit 9a72d1a

Browse files
author
RetoStutz
committed
bugfix compiling incorrect due to missing methods
1 parent 0747630 commit 9a72d1a

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

Tutorial/Eigenes Projekt/Projektstart/runConfigurations/EigenesProjekt-Projektstart.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<option name="ALTERNATIVE_JRE_PATH" value="17" />
44
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
55
<option name="MAIN_CLASS_NAME" value="Main" />
6-
<module name="pi4j-programming-tutorial.Tutorial-Eigenes_Projekt-Projektstart.main" />
6+
<module name="pi4j-programming-tutorial" />
77
<method v="2">
88
<option name="Make" enabled="true" />
99
</method>

Tutorial/Erste Komponente/Implementation LED/task-info.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,3 @@ files:
2626
visible: true
2727
- name: src/ErsteKomponente-ImplementationLED.run.xml
2828
visible: false
29-
- name: src/SimpleLED.java
30-
visible: true

Tutorial/Klassenmodifizierung/Implementation Klassenwiederverwendung/src/Main.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,28 @@ protected String[] getProviders() {
3737
LedButton ledButton = new LedButton(pi4j, PIN.D26, Boolean.FALSE, PIN.PWM19);
3838

3939
// Turn on the LED to have a defined state
40-
ledButton.ledOn();
40+
//ledButton.ledOn();
4141

4242
//see the LED for a Second
4343
sleep(1000);
4444

4545
// Register event handlers to print a message when pressed (onDown) and depressed (onUp)
46-
ledButton.btnOnDown(() -> System.out.println("Pressing the Button"));
47-
ledButton.btnOnUp(() -> System.out.println("Stopped pressing."));
46+
//ledButton.btnOnDown(() -> System.out.println("Pressing the Button"));
47+
//ledButton.btnOnUp(() -> System.out.println("Stopped pressing."));
4848

4949
// Wait for 15 seconds while handling events before exiting
5050
System.out.println("Press the button to see it in action!");
5151

5252
// Make a flashing light by toggling the LED every second
5353
// in the meantime, the Button can still be pressed, as we only freeze the main thread
5454
for (int i = 0; i < 15; i++) {
55-
System.out.println(ledButton.ledToggleState());
55+
//System.out.println(ledButton.ledToggleState());
5656
sleep(1000);
5757
}
5858

5959
// Unregister all event handlers to exit this application in a clean way
60-
ledButton.btnDeRegisterAll();
61-
ledButton.ledOff();
60+
//ledButton.btnDeRegisterAll();
61+
//ledButton.ledOff();
6262

6363
// End of application
6464
System.out.println("Application is done");

Tutorial/Klassenmodifizierung/Implementation Klassenwiederverwendung/task-info.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ files:
1111
placeholder_text: /* TODO initialize the objects button and led */
1212
- offset: 775
1313
length: 347
14-
placeholder_text: /* TODO create the led functions on the ledbutton */
14+
placeholder_text: /* TODO create the led functions on the ledButton */
1515
- offset: 1128
1616
length: 814
17-
placeholder_text: /* TODO create the button functions on the ledbutton */
17+
placeholder_text: /* TODO create the button functions on the ledButton */
1818
- name: src/Main.java
1919
visible: true
2020
- name: src/SimpleButton.java
@@ -23,13 +23,11 @@ files:
2323
visible: false
2424
- name: src/Component.java
2525
visible: false
26-
- name: src/SimpleLED.java
27-
visible: true
28-
- name: test/LEDButtonTest.java
29-
visible: false
3026
- name: test/ComponentTest.java
3127
visible: false
3228
- name: src/Klassenmodifizierung-ImplementationWiederverwendung.run.xml
3329
visible: false
3430
- name: src/SimpleLed.java
3531
visible: true
32+
- name: test/LedButtonTest.java
33+
visible: false

Tutorial/Klassenmodifizierung/Implementation Klassenwiederverwendung/task.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Die neue Komponente soll die zwei vorhandenen Objekte mit ihren Methoden als ein
1212

1313
## Aufgabe
1414
### Programmierung
15+
## Main.java
16+
Die Funktionen ledButton sind auskommentiert, damit die Übersetzung funktioniert. Kommentiere alle Funktionen
17+
(6 Zeilen) wieder ein.
18+
## LedButton.java
1519
- Deklariere zwei Objekte led und button mit SimpleLed und SimpleButton
1620
- Initialisiere die beiden Objekte im Konstruktor von LedButton
1721
- Schreibe die unten erwähnten Methoden. Verwende dazu die Methoden von *led*.

0 commit comments

Comments
 (0)