Skip to content

Commit fe5fe7b

Browse files
committed
Matrix tweaks
1 parent 7b9c22b commit fe5fe7b

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/components/led/microbit-matrix.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,17 @@ export class MicrobitMatrix {
5858
return;
5959
}
6060

61+
this.matrix = await this.services.ledService.getMatrixState();
6162
await this.updateMatrix();
6263
}
6364

64-
render() {
65-
return <div></div>;
66-
}
67-
6865
private async toggle(row: number, column: number) {
6966
this.matrix[row][column] = !this.matrix[row][column];
7067
await this.services.ledService.setMatrixState(this.matrix);
7168
await this.updateMatrix();
7269
}
7370

7471
private async updateMatrix() {
75-
this.matrix = await this.services.ledService.getMatrixState();
7672
this.matrix.forEach((rows: Boolean[], row) => {
7773
rows.forEach((value: boolean, column) => {
7874
const led = this.elements[row][column];

src/index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
.microbit-matrix {
2828
display: flex;
2929
flex-wrap: wrap;
30-
justify-content: space-between;
31-
align-content: space-between;
32-
width: 170px;
33-
height: 170px;
30+
width: 155px;
3431
background-color: black;
3532
}
3633
.microbit-matrix-led {

0 commit comments

Comments
 (0)