matrice_de_led_16x32_seeed
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
matrice_de_led_16x32_seeed [2015/04/02 13:11] – created 86.73.246.210 | matrice_de_led_16x32_seeed [2015/04/02 13:48] (current) – 86.73.246.210 | ||
---|---|---|---|
Line 22: | Line 22: | ||
^LEDMatrix|a, | ^LEDMatrix|a, | ||
^begin|*displaybuf, | ^begin|*displaybuf, | ||
- | ^drawPoint|x, | + | ^drawPoint|x, |
^drawRect|x1, | ^drawRect|x1, | ||
^drawImage|xoffset, | ^drawImage|xoffset, | ||
Line 31: | Line 31: | ||
^on| |turn on the led matrix ?| | ^on| |turn on the led matrix ?| | ||
^off| |turn off the led matrix ?| | ^off| |turn off the led matrix ?| | ||
+ | |||
+ | ===== Code minimal (proposition) ===== | ||
+ | Nécéssite les librairies appropriées | ||
+ | |||
+ | < | ||
+ | #include " | ||
+ | |||
+ | #define WIDTH 32 | ||
+ | #define HEIGHT | ||
+ | |||
+ | LEDMatrix matrix(4, 5, 6, 7, 8, 9, 10, 11); // LEDMatrix(a, | ||
+ | uint8_t displaybuf[WIDTH *HEIGHT / 8]; // Display Buffer | ||
+ | int frequency= 1000; | ||
+ | |||
+ | void setup() { | ||
+ | matrix.begin(displaybuf, | ||
+ | Serial.begin(9600); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | static uint32_t lastCountTime = 0; | ||
+ | static uint8_t count = 0; | ||
+ | |||
+ | matrix.scan(); | ||
+ | |||
+ | if ((millis() - lastCountTime) > frequency) { | ||
+ | lastCountTime = millis(); | ||
+ | // votre code ici | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== buffer ==== | ||
+ | |||
+ | On peut spécifier un buffer : | ||
+ | < | ||
+ | uint8_t displaybuf[WIDTH *HEIGHT / 8] = { | ||
+ | 0x00, 0x00, 0x00, 0x00, // 0 | ||
+ | 0x00, 0x30, 0x0C, 0x00, // 1 | ||
+ | 0x00, 0x48, 0x12, 0x00, // 2 | ||
+ | 0x00, 0x44, 0x22, 0x00, // 3 | ||
+ | 0x00, 0x43, 0xC2, 0x00, // 4 | ||
+ | 0x00, 0x40, 0x02, 0x00, // 5 | ||
+ | 0x00, 0x80, 0x01, 0x00, // 6 | ||
+ | 0x00, 0x84, 0x09, 0x00, // 7 | ||
+ | 0x00, 0x8C, 0x59, 0x00, // 8 | ||
+ | 0x00, 0x80, 0x01, 0x00, // 9 | ||
+ | 0x00, 0x84, 0x91, 0x00, // 10 | ||
+ | 0x00, 0x47, 0xF2, 0x00, // 11 | ||
+ | 0x00, 0x20, 0x04, 0x00, // 12 | ||
+ | 0x00, 0x1F, 0xF8, 0x00, // 13 | ||
+ | 0x00, 0x00, 0x00, 0x00, // 14 | ||
+ | 0x00, 0x00, 0x00, 0x00, // 15 | ||
+ | }; | ||
+ | </ |
matrice_de_led_16x32_seeed.1427973079.txt.gz · Last modified: 2015/04/02 13:11 by 86.73.246.210