Permalink
Browse files

Minor updates.

  • Loading branch information...
marcmerlin committed Jan 15, 2015
1 parent da84e21 commit e2b2a0ce5b5e522f6e8249100830a6244327b316
Showing with 30 additions and 16 deletions.
  1. +0 −4 LED_Matrix.cpp
  2. +11 −0 LED_Matrix.h
  3. +19 −12 examples/directmatrix8x8_tricolor_direct_sr/directmatrix8x8_tricolor_direct_sr.ino
View
@@ -23,8 +23,6 @@
- http://www.codeproject.com/Articles/732646/Fast-digital-I-O-for-Arduino
(this is not required, but makes things 3x faster)
****************************************************/
#ifdef __AVR_ATtiny85__
@@ -36,8 +34,6 @@
#include "LED_Matrix.h"
#include "Adafruit_GFX.h"
/*********************** PWM DIRECT MATRIX OBJECT */
// Globals required to pass matrix data into the ISR.
// (volatile is required for ISRs)
volatile uint8_t ROW_OFF;
View
@@ -49,6 +49,17 @@
#define LED_ORANGE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM)
#define LED_ORANGE_HIGH (LED_RED_HIGH + LED_GREEN_HIGH)
#define LED_PURPLE_VERYLOW (LED_RED_VERYLOW + LED_BLUE_VERYLOW)
#define LED_PURPLE_LOW (LED_RED_LOW + LED_BLUE_LOW)
#define LED_PURPLE_MEDIUM (LED_RED_MEDIUM + LED_BLUE_MEDIUM)
#define LED_PURPLE_HIGH (LED_RED_HIGH + LED_BLUE_HIGH)
#define LED_CYAN_VERYLOW (LED_GREEN_VERYLOW + LED_BLUE_VERYLOW)
#define LED_CYAN_LOW (LED_GREEN_LOW + LED_BLUE_LOW)
#define LED_CYAN_MEDIUM (LED_GREEN_MEDIUM + LED_BLUE_MEDIUM)
#define LED_CYAN_HIGH (LED_GREEN_HIGH + LED_BLUE_HIGH)
#define LED_WHITE_VERYLOW (LED_RED_VERYLOW + LED_GREEN_VERYLOW + LED_BLUE_VERYLOW)
#define LED_WHITE_LOW (LED_RED_LOW + LED_GREEN_LOW + LED_BLUE_LOW)
#define LED_WHITE_MEDIUM (LED_RED_MEDIUM + LED_GREEN_MEDIUM + LED_BLUE_MEDIUM)
@@ -27,7 +27,14 @@
#define DEBUG 0
// FIXME, give 595 pinout
/* SR595 pins:
VCC QA SER !OE RCLK SRCLCK !SRCLR !QH
16 15 14 13 12 11 10 9
| GND | | VCC NC
| | ` clock to feed SER bit
input ` Latch
*/
#define DATA_PIN DP13
#define CLK_PIN DP19
@@ -99,6 +106,17 @@ static const uint8_t PROGMEM
static const uint16_t PROGMEM
RGB_bmp[][64] = {
// blue, blue/red, red, red/green, green, green/blue, blue, white
// 1 2 3 4 6 8 A F
{ 0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00,
0x101, 0x202, 0x303, 0x404, 0x606, 0x808, 0xA0A, 0xF0F,
0x001, 0x002, 0x003, 0x004, 0x006, 0x008, 0x00A, 0x00F,
0x011, 0x022, 0x033, 0x044, 0x066, 0x088, 0x0AA, 0x0FF,
0x010, 0x020, 0x030, 0x040, 0x060, 0x080, 0x0A0, 0x0F0,
0x110, 0x220, 0x330, 0x440, 0x660, 0x880, 0xAA0, 0xFF0,
0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00,
0x111, 0x222, 0x333, 0x444, 0x666, 0x888, 0xAAA, 0xFFF, },
// grey to white
{ 0x111, 0x222, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF,
0x222, 0x222, 0x333, 0x555, 0x777, 0x999, 0xAAA, 0xFFF,
@@ -139,17 +157,6 @@ static const uint16_t PROGMEM
0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xA00, 0xF00,
0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, },
// blue, blue/red, red, red/green, green, green/blue, blue, white
// 1 2 3 4 6 8 A F
{ 0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00,
0x101, 0x202, 0x303, 0x404, 0x606, 0x808, 0xA0A, 0xF0F,
0x001, 0x002, 0x003, 0x004, 0x006, 0x008, 0x00A, 0x00F,
0x011, 0x022, 0x033, 0x044, 0x066, 0x088, 0x0AA, 0x0FF,
0x010, 0x020, 0x030, 0x040, 0x060, 0x080, 0x0A0, 0x0F0,
0x110, 0x220, 0x330, 0x440, 0x660, 0x880, 0xAA0, 0xFF0,
0x100, 0x200, 0x300, 0x400, 0x600, 0x800, 0xA00, 0xF00,
0x111, 0x222, 0x333, 0x444, 0x666, 0x888, 0xAAA, 0xFFF, },
// 1 black, 2R, 2O, 2G, 1B with 4 blue lines rising right
{ 0x000, 0x200, 0x000, 0x400, 0x000, 0x800, 0x000, 0xF00,
0x000, 0x201, 0x002, 0x403, 0x004, 0x805, 0x006, 0xF07,

0 comments on commit e2b2a0c

Please sign in to comment.