User Tools

Site Tools


matrice_de_led_16x32_seeed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
matrice_de_led_16x32_seeed [2015/04/02 13:11] – created 86.73.246.210matrice_de_led_16x32_seeed [2015/04/02 13:48] (current) 86.73.246.210
Line 22: Line 22:
 ^LEDMatrix|a, b, c, d, oe, r1, stb, clk|constructeur| ^LEDMatrix|a, b, c, d, oe, r1, stb, clk|constructeur|
 ^begin|*displaybuf, width, height|initialisation ?| ^begin|*displaybuf, width, height|initialisation ?|
-^drawPoint|x, y, pixel|permet d'allumer/éteindre un pixel à une position x. pixel = 0/1 (allumé/éteint)|+^drawPoint|x, y, pixel|permet d'allumer/éteindre un pixel à une position x,y. pixel = 0/1 (allumé/éteint)|
 ^drawRect|x1, y1, x2, y2, pixel)|dessine un rectangle. pixel : cf ci-dessus.| ^drawRect|x1, y1, x2, y2, pixel)|dessine un rectangle. pixel : cf ci-dessus.|
 ^drawImage|xoffset, yoffset, width, height, *image|dessine une image. *image = ?| ^drawImage|xoffset, yoffset, width, height, *image|dessine une image. *image = ?|
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
 +
 +<code>
 +#include "LEDMatrix.h"
 +
 +#define WIDTH   32
 +#define HEIGHT  16
 +
 +LEDMatrix matrix(4, 5, 6, 7, 8, 9, 10, 11);     // LEDMatrix(a, b, c, d, oe, r1, stb, clk);
 +uint8_t displaybuf[WIDTH *HEIGHT / 8];          // Display Buffer
 +int frequency= 1000;
 +
 +void setup() {
 +    matrix.begin(displaybuf, WIDTH, HEIGHT);
 +    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
 +    }
 +}
 +</code>
 +
 +==== buffer ====
 +
 +On peut spécifier un buffer :
 +<code>
 +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
 +};
 +</code>
matrice_de_led_16x32_seeed.1427973079.txt.gz · Last modified: 2015/04/02 13:11 by 86.73.246.210