Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
markgrecowork
 
Posts: 11
Joined: Sat Nov 16, 2013 1:37 pm

Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by markgrecowork »

I'm a newbie builder and have a tough time with code. I would love arduino code help with using 3 8x8 1.2" side by side.

I can follow directions very well. if the scrolling message said adafruit that would be a bonus!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by adafruit_support_rick »

I've moved your topic to the General Project Help forum!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by adafruit_support_mike »


User avatar
markgrecowork
 
Posts: 11
Joined: Sat Nov 16, 2013 1:37 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by markgrecowork »

thanks a bunch

User avatar
markgrecowork
 
Posts: 11
Joined: Sat Nov 16, 2013 1:37 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by markgrecowork »

Got the Adafruit example going.
I changed hello world to my name.
I wanted to scroll the alphabet but it will only display about 8 or so letters in a row.
Any ideas?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by adafruit_support_rick »

Please post the code you're using

User avatar
markgrecowork
 
Posts: 11
Joined: Sat Nov 16, 2013 1:37 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by markgrecowork »

Code: Select all

#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 Test");
  
  matrix.begin(0x70);  // pass in the address
}

static const uint8_t PROGMEM
  smile_bmp[] =
  { B00111100,
    B01000010,
    B10100101,
    B10000001,
    B10100101,
    B10011001,
    B01000010,
    B00111100 },
  neutral_bmp[] =
  { B00111100,
    B01000010,
    B10100101,
    B10000001,
    B10111101,
    B10000001,
    B01000010,
    B00111100 },
  frown_bmp[] =
  { B00111100,
    B01000010,
    B10100101,
    B10000001,
    B10011001,
    B10100101,
    B01000010,
    B00111100 };

void loop() {
  matrix.clear();
  matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_ON);
  matrix.writeDisplay();
  delay(500);

  matrix.clear();
  matrix.drawBitmap(0, 0, neutral_bmp, 8, 8, LED_ON);
  matrix.writeDisplay();
  delay(500);

  matrix.clear();
  matrix.drawBitmap(0, 0, frown_bmp, 8, 8, LED_ON);
  matrix.writeDisplay();
  delay(500);

  matrix.clear();      // clear display
  matrix.drawPixel(0, 0, LED_ON);  
  matrix.writeDisplay();  // write the changes we just made to the display
  delay(500);

  matrix.clear();
  matrix.drawLine(0,0, 7,7, LED_ON);
  matrix.writeDisplay();  // write the changes we just made to the display
  delay(500);

  matrix.clear();
  matrix.drawRect(0,0, 8,8, LED_ON);
  matrix.fillRect(2,2, 4,4, LED_ON);
  matrix.writeDisplay();  // write the changes we just made to the display
  delay(500);

  matrix.clear();
  matrix.drawCircle(3,3, 3, LED_ON);
  matrix.writeDisplay();  // write the changes we just made to the display
  delay(500);

  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("Hello");
    matrix.writeDisplay();
    delay(100);
  }
  matrix.setRotation(3);
  for (int8_t x=7; x>=-36; x--) {
    matrix.clear();
    matrix.setCursor(x,0);
    matrix.print("World");
    matrix.writeDisplay();
    delay(100);
  }
  matrix.setRotation(0);
}

User avatar
markgrecowork
 
Posts: 11
Joined: Sat Nov 16, 2013 1:37 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by markgrecowork »

Sorry this is the code I'm using from your great site. I figured out how to turn so I could scroll my name I'm using an uno rev 3

I'm a novice but a fast learner

User avatar
markgrecowork
 
Posts: 11
Joined: Sat Nov 16, 2013 1:37 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by markgrecowork »

Again sorry turn the led figures all one way as the code turns it 90 degrees

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by adafruit_support_rick »

I'm not real familiar with this code, but I think you need to increase (well, decrease) the number -36 in the two loops to get more characters to scroll.
Try changing it to -72

Code: Select all

  for (int8_t x=0; x>=-72; x--) {
    matrix.clear();
    matrix.setCursor(x,0);
    matrix.print("Hello");
    matrix.writeDisplay();
    delay(100);
  }
  matrix.setRotation(3);
  for (int8_t x=7; x>=-72; x--) {
    matrix.clear();
    matrix.setCursor(x,0);
    matrix.print("World");
    matrix.writeDisplay();
    delay(100);
  }

User avatar
markgrecowork
 
Posts: 11
Joined: Sat Nov 16, 2013 1:37 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by markgrecowork »

Thanks I will try it

User avatar
Mysticforce
 
Posts: 20
Joined: Thu May 28, 2015 12:47 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by Mysticforce »

Hello I am using the same code as above. All I would like to do is scroll text across two of them. I got that code to work but, I have no clue how to have text scroll across two of them. please help. I set the one to x70 and the other to x71.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by adafruit_support_rick »

I'll assume your matrices are called matrix1 and matrix2:

Code: Select all

  for (int8_t x=0; x>=-72; x--) {
    matrix1.clear();
    matrix2.clear();
    matrix1.setCursor(x,0);
    matrix2.setCursor(x-8,0);
    matrix1.print("Hello");
    matrix2.print("Hello");
    matrix1.writeDisplay();
    matrix2.writeDisplay();
    delay(100);
  }

User avatar
Mysticforce
 
Posts: 20
Joined: Thu May 28, 2015 12:47 pm

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by Mysticforce »

adafruit_support_rick wrote:I'll assume your matrices are called matrix1 and matrix2:

Code: Select all

  for (int8_t x=0; x>=-72; x--) {
    matrix1.clear();
    matrix2.clear();
    matrix1.setCursor(x,0);
    matrix2.setCursor(x-8,0);
    matrix1.print("Hello");
    matrix2.print("Hello");
    matrix1.writeDisplay();
    matrix2.writeDisplay();
    delay(100);
  }

I get this error code:
adafruit_support_rick wrote:I'll assume your matrices are called matrix1 and matrix2:

Code: Select all

  for (int8_t x=0; x>=-72; x--) {
    matrix1.clear();
    matrix2.clear();
    matrix1.setCursor(x,0);
    matrix2.setCursor(x-8,0);
    matrix1.print("Hello");
    matrix2.print("Hello");
    matrix1.writeDisplay();
    matrix2.writeDisplay();
    delay(100);
  }
Arduino: 1.6.5 (Windows 8.1), Board: "SparkFun Pro Micro 5V/16MHz"

i2cscrollers:1: error: expected unqualified-id before 'for'
i2cscrollers:1: error: 'x' does not name a type
i2cscrollers:1: error: 'x' does not name a type
expected unqualified-id before 'for'

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Small 1.2" 8x8 LED Matrix w/I2C HELP SCROLLING

Post by adafruit_support_rick »

Post your entire sketch.

You're not trying to run just the for loop, are you? That's just a snippet of code. You need an entire sketch.

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

Return to “General Project help”