AugenMatrix
Die Klasse EyesMatrix steuert die NeoPixel-LED-Matrix (Eliobots Augen): 2 8×8-Matrizen für insgesamt 128 LEDs.
Physisches Layout
Œil droit (indices 0–63) Œil gauche (indices 64–127)
[ 0][ 1][ 2][ 3][ 4][ 5][ 6][ 7] [ 64][ 65][ 66][ 67][ 68][ 69][ 70][ 71]
[ 8][ 9][ 10][ 11][ 12][ 13][ 14][ 15] [ 72][ 73][ 74][ 75][ 76][ 77][ 78][ 79]
[ 16][ 17][ 18][ 19][ 20][ 21][ 22][ 23] [ 80][ 81][ 82][ 83][ 84][ 85][ 86][ 87]
[ 24][ 25][ 26][ 27][ 28][ 29][ 30][ 31] [ 88][ 89][ 90][ 91][ 92][ 93][ 94][ 95]
[ 32][ 33][ 34][ 35][ 36][ 37][ 38][ 39] [ 96][ 97][ 98][ 99][100][101][102][103]
[ 40][ 41][ 42][ 43][ 44][ 45][ 46][ 47] [104][105][106][107][108][109][110][111]
[ 48][ 49][ 50][ 51][ 52][ 53][ 54][ 55] [112][113][114][115][116][117][118][119]
[ 56][ 57][ 58][ 59][ 60][ 61][ 62][ 63] [120][121][122][123][124][125][126][127]
Initialisierung
import board
from elio import EyesMatrix
eyes = EyesMatrix(board.IO2, brightness=0.05)
| Paramètre | Type | Défaut | Description |
|---|---|---|---|
pin | Pin | — | Pin de la matrice NeoPixel |
brightness | float | 0.05 | Luminosité (0.0 à 1.0) |
Anzeigemethoden
set_matrix_colors(led_colors)
Definiert die Farbe jeder LED aus einer Liste von 128 RGB-Tupeln.
colors = [(255, 0, 0)] * 64 + [(0, 0, 255)] * 64 # Œil droit rouge, gauche bleu
eyes.set_matrix_colors(colors)