Skip to content

Commit

Permalink
Jannes updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DieterHolz committed Aug 5, 2023
1 parent f4e35f4 commit 57d4064
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public void execute(Context pi4j) {

// Stop the button matrix poller now that the application has ended
buttonMatrix.stopPoller();
sleep(3000);
}

private List<String> determinePlayers() {
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/pi4j/crowpi/applications/LedMatrixApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ public void execute(Context pi4j) {
matrix.setEnabled(true);
matrix.setBrightness(7);

for(int row = 0; row < 8;row++){
for(int col = 0; col < 8; col++){
matrix.setPixel(row, col, true);
}
}
matrix.refresh();
sleep(2000);

for(int row = 0; row < 8;row++){
for(int col = 0; col < 8; col++){
matrix.setPixel(row, col, false);
}
}
matrix.refresh();
sleep(2000);


// Draw a cross with a circle over it using a Graphics2D lambda function
// Further commands for Graphics2D can be found in the official Java documentation
// This can be adjusted to draw your own symbols and images on the LED matrix
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pi4j/crowpi/applications/RfidApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void execute(Context pi4j) {
// Read `Person` object from card and print it
try {
final var person = card.readObject(Person.class);
System.out.println("Read person from card: " + person);
System.out.println("Hi, " + person.firstName + ". \uD83D\uDD96");
} catch (RfidException e) {
System.out.println("Could not read person from card: " + e.getMessage());
}
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/pi4j/crowpi/applications/SevenSegmentApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ public void execute(Context pi4j) {
segment.setBlinkRate(0);
segment.setBrightness(15);

for(int i=0; i<4;i++){
segment.setDigit(i, '8');
segment.setDecimalPoint(i, true);
}
segment.setColon(true);
segment.refresh();

sleep(2000);

for(int i=0; i<4;i++){
segment.clear();
segment.setDecimalPoint(i, false);
}
segment.setColon(false);
segment.refresh();

sleep(2000);

// Manually set some digits and symbols to demonstrate the advanced API
segment.setDigit(0, '1'); // Place the character "1" into the first digit
segment.setDecimalPoint(0, true); // Activate the decimal point after the first digit
Expand Down

0 comments on commit 57d4064

Please sign in to comment.