mini 8x8 questions

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
carlw
 
Posts: 26
Joined: Mon Apr 09, 2012 9:10 am

mini 8x8 questions

Post by carlw »

I was able to get the example Arduino sketch to work with the mini 8x8 LED green dot matrix and a MEGA.

Confused by the datasheet, first question is:
What is the maximum current draw for this device?
30mA?

Second question is:
Is there any way to use software I2C?

Thanks. :D

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: mini 8x8 questions

Post by adafruit_support_bill »

I haven't measured the current draw, but since it is a multiplexed display, there will be 8 LEDs on at a time. I would estimate the max current draw to be about 180 mA (20 mA per led plus some for the chip).

Software I2C should be possible, but it would require a bit of library hacking.

User avatar
carlw
 
Posts: 26
Joined: Mon Apr 09, 2012 9:10 am

Re: mini 8x8 questions

Post by carlw »

Thank you.

Most of this sketch was copied from another Adafruit learning example.

Space Invaders Aliens for a regular Arduino and the mini 8x8...

Code: Select all

/*************************************************** 
 * This is a library for our I2C LED Backpacks
 * 
 * Designed specifically to work with the Adafruit LED Matrix backpacks 
 * ----> http://www.adafruit.com/products/872
 * ----> http://www.adafruit.com/products/871
 * ----> http://www.adafruit.com/products/870
 * 
 * These displays use I2C to communicate, 2 pins are required to 
 * interface. There are multiple selectable I2C addresses. For backpacks
 * with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
 * with 3 Address Select pins: 0x70 thru 0x77
 * 
 * Adafruit invests time and resources providing this open source code, 
 * please support Adafruit and open-source hardware by purchasing 
 * products from Adafruit!
 * 
 * Written by Limor Fried/Ladyada for Adafruit Industries.  
 * BSD license, all text above must be included in any redistribution
 ****************************************************/

#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

void setup() {
  Serial.begin(9600);
  Serial.println("8x8 LED Matrix - Space Invaders - Display Aliens Test");

  matrix.begin(0x70);  // pass in the address
}

static const uint8_t PROGMEM
alien1A_bmp[] =
{ 
  B00011000, // This is the first frame for alien #1
  B00111100, // If you squint you can kind of see the
  B01111110, // image in the 0's and 1's.
  B11011011,
  B11111111,
  B00100100,
  B01011010,
  B10100101,
}
,
alien1B_bmp[] =
{ 
  B00011000, // This is the second frame for alien #1
  B00111100,
  B01111110,
  B11011011,
  B11111111,
  B00100100,
  B01011010,
  B01000010,
}
,
alien2A_bmp[] =
{ 
  B00000000, // First frame for alien #2
  B00111100,
  B01111110,
  B11011011,
  B11011011,
  B01111110,
  B00100100,
  B11000011,
}
,
alien2B_bmp[] =
{  
  B00111100, // Second frame for alien #2
  B01111110,
  B11011011,
  B11011011,
  B01111110,
  B00100100,
  B00100100,
  B00100100, 
}
,
alien3A_bmp[] =
{
  B00100100, // First frame for alien #3
  B00100100,
  B01111110,
  B11011011,
  B11111111,
  B11111111,
  B10100101,
  B00100100,
}
,
alien3B_bmp[] =
{
  B00100100, // Second frame for alien #3
  B10100101,
  B11111111,
  B11011011,
  B11111111,
  B01111110,
  B00100100,
  B01000010,
}
,
alien4A_bmp[] =
{   
  B00111100, // First frame for alien #4
  B01111110,
  B00110011,
  B01111110,
  B00111100,
  B00000000,
  B00001000,
  B00000000,
}
,
alien4B_bmp[] =
{ 
  B00111100, // Second frame for alien #4
  B01111110,
  B10011001,
  B01111110,
  B00111100,
  B00000000,
  B00001000,
  B00001000,
}
,
alien4C_bmp[] =
{
  B00111100, // Third frame for alien #4 (NOT a repeat of frame 1)
  B01111110,
  B11001100,
  B01111110,
  B00111100,
  B00000000,
  B00000000,
  B00001000,
}
,
alien4D_bmp[] =
{ 
  B00111100, // Fourth frame for alien #4 (NOT a repeat of frame 2)
  B01111110,
  B01100110,
  B01111110,
  B00111100,
  B00000000,
  B00000000,
  B00000000,
};

void loop() {

  matrix.setTextSize(1);
  matrix.setTextWrap(false);  // we dont want text to wrap so it scrolls nicely
  matrix.setTextColor(LED_ON);
  for (int8_t x=0; x>=-36; x--) {
    matrix.clear();
    matrix.setCursor(x,0);
    matrix.print("Aliens!");
    matrix.writeDisplay();
    delay(100);
  }

  for (byte times = 1; times <= 2; times ++) {
    matrix.clear();
    matrix.drawBitmap(0, 0, alien1A_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(250);

    matrix.clear();
    matrix.drawBitmap(0, 0, alien1B_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(250);
  }

  for (byte times = 1; times <= 2; times ++) {
    matrix.clear();
    matrix.drawBitmap(0, 0, alien2A_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(250);

    matrix.clear();
    matrix.drawBitmap(0, 0, alien2B_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(250);
  }

  for (byte times = 1; times <= 2; times ++) {
    matrix.clear();
    matrix.drawBitmap(0, 0, alien3A_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(250);

    matrix.clear();
    matrix.drawBitmap(0, 0, alien3B_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(250);
  }

  for (byte times = 1; times <= 2; times ++) {
    matrix.clear();
    matrix.drawBitmap(0, 0, alien4A_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(125);

    matrix.clear();
    matrix.drawBitmap(0, 0, alien4B_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(125);

    matrix.clear();
    matrix.drawBitmap(0, 0, alien4C_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(125);

    matrix.clear();
    matrix.drawBitmap(0, 0, alien4D_bmp, 8, 8, LED_ON);
    matrix.writeDisplay();
    delay(125);    
  }
}

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”