X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Hub08_LedMatrix%2FHub08_LedMatrix.ino;h=ce966234cda65ffdd51446e116da94c23d1b5649;hb=6bc2030a3b0a0a4c9dc7203a325fdfacdae55be6;hp=95d335d457406d827f6716eddf3caf3cce0da4f2;hpb=81056696474a1bf3219ae8a34d1da94f5ecb9a30;p=Arduino diff --git a/Hub08_LedMatrix/Hub08_LedMatrix.ino b/Hub08_LedMatrix/Hub08_LedMatrix.ino index 95d335d..ce96623 100644 --- a/Hub08_LedMatrix/Hub08_LedMatrix.ino +++ b/Hub08_LedMatrix/Hub08_LedMatrix.ino @@ -24,15 +24,19 @@ #define WIDTH 64*1 // 2 panels * 64 #define HEIGHT 16 +#if USE_SPI +#include // Arduino IDE compilation won't work without this +#endif + +// hub08 pinout: la lb lc ld en r1 lat clk // LEDMatrix(a, b, c, d, oe, r1, stb, clk); LEDMatrix matrix(4, 5, 6, 7, 9, 11, 10, 13); // Display Buffer 128 = 64 * 16 / 8 -uint8_t displaybuf[WIDTH * HEIGHT / 8]; +uint8_t displaybuf[(WIDTH/8) * HEIGHT*2]; uint8_t displaybuf_w[((WIDTH/8)+1) * HEIGHT]; - byte cell[16]; void MatrixWriteCharacter(int x,int y, char character) @@ -51,7 +55,7 @@ void MatrixWriteCharacter(int x,int y, char character) } //uint8_t *pDst = displaybuf_w + (y) * ((WIDTH / 8) + 1) + x ; - uint8_t *pDst = displaybuf_w + x ; + uint8_t *pDst = displaybuf_w + x + y * ((WIDTH/8)+1); byte mask = 1; for(int j=0; j<8; j++) { @@ -105,7 +109,7 @@ void matrixPrint(String c) { void setup() { matrix.begin(displaybuf, WIDTH, HEIGHT); - Serial.begin(57600); + Serial.begin(115200); matrix.clear(); //matrixPrint("12345678"); // uint8_t *pDst = displaybuf + y * (WIDTH / 8) + x / 8; @@ -117,31 +121,54 @@ void matrixDelay(int x) { } -String poruka="X XX XOX XOOX XOoOX XOooOX XOoIoOX XOoiioOX "; +//String poruka="X XX XOX XOOX XOoOX XOooOX XOoIoOX XOoiioOX "; //String poruka=" Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit libero id ex dapibus suscipit. Proin vitae cursus eros. Ut porttitor congue metus at viverra. In consectetur ex massa."; +String poruka="!\"#$%&'()*+,-./0123456789:;<=>?@AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqReSsTtUuVvWwXxYyZz[\\]^_`{|}~"; +//String poruka="~"; + +int pos = 0; // position in circular display void loop() { for (int p=0; p