Could someone please help me?

Hi, I am working on a project and I am starting to learn the basics. However I am getting weird results and wonder if I have any idea as to what is going on....

So here is what I am using

  • Arduino Uno
  • Red bear labs Bluetooth 4.0 Low Energy - BLE Shield v2.0
  • Adafruit 16x32 led matrix

The problem I am seeing is as follows:
I can see Bluetooth device and I am able to connect, however when I turn on the matrix the connection drops, and the things it should display are jumbled up...

Is this the problem?
The BLE board and the matrix both use certain pins such as A0, clk etc however the shield does have an area to connect pins into the back of it so I should be able to use these pins right?

If this is the problem, how would I be able to get around this?

Thanks

Please read the "how to post" message, and post your code, using code tags.

Hi there, thanks for the reply..
I thought the question was more about the pins etc,
Here is my code

#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
#include <SPI.h>
#include <EEPROM.h>
#include <boards.h>
#include <RBL_nRF8001.h>

// Similar to F(), but for PROGMEM string pointers rather than literals
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr

#define CLK 8  // MUST be on PORTB! (Use pin 11 on Mega)
#define LAT A3
#define OE  9
#define A   A5
#define B   A4
#define C   A2

RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true);

int x = matrix.width();
int y = 0;

void setup() {
  Serial.begin(250000); 
  
  ble_set_pins(13, 12);
  ble_set_name("test");
  ble_begin();

  // put your setup code here, to run once:
  matrix.begin();
  matrix.setTextWrap(false); // Allow text to run off right edge
  matrix.setTextSize(2);
}

bool reversing = false;

void drawFrameOne(int x){
  matrix.drawRect(x - 3, 0, 6, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x - 4, 1, 8, 1, matrix.Color333(0, 5, 0));
  
  matrix.drawRect(x - 6, 2, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 4, 2, 1, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x - 3, 2, 6, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 3, 2, 1, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 5, 2, 1, 1, matrix.Color333(5, 5, 5));
  
  matrix.drawRect(x - 6, 3, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 4, 3, 8, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 5, 3, 1, 1, matrix.Color333(5, 5, 5));

  matrix.drawRect(x - 6, 4, 2, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 4, 4, 1, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 3, 4, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 2, 4, 1, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x - 1, 4, 2, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 1, 4, 1, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 2, 4, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 3, 4, 1, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 4, 4, 2, 1, matrix.Color333(5, 5, 5));

  matrix.drawRect(x - 6, 5, 2, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 4, 5, 1, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 3, 5, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 2, 5, 1, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 1, 5, 2, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 1, 5, 1, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 2, 5, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 3, 5, 1, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 4, 5, 2, 1, matrix.Color333(5, 5, 5));
  
  matrix.drawRect(x - 5, 6, 10, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 5, 6, 1, 1, matrix.Color333(7, 1, 0));

  matrix.drawRect(x - 4, 7, 1, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x - 3, 7, 2, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 1, 7, 2, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 1, 7, 2, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 3, 7, 1, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 4, 7, 2, 1, matrix.Color333(7, 1, 0));

  matrix.drawRect(x - 6, 8, 5, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 1, 8, 3, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 2, 8, 3, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 5, 8, 1, 1, matrix.Color333(5, 5, 5));

  matrix.drawRect(x - 7, 9, 2, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 5, 9, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 4, 9, 4, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x    , 9, 5, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 5, 9, 1, 1, matrix.Color333(5, 5, 5));

  matrix.drawRect(x - 7, 10, 1, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 6, 10, 3, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 3, 10, 2, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 1, 10, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x    , 10, 2, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 2, 10, 2, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 4, 10, 1, 1, matrix.Color333(7, 1, 0));

  matrix.drawRect(x - 7, 11, 2, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 5, 11, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 4, 11, 3, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 1, 11, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x    , 11, 1, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 1, 11, 3, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 4, 11, 1, 1, matrix.Color333(0, 5, 0));

  matrix.drawRect(x - 7, 12, 2, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 5, 12, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x - 4, 12, 3, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 1, 12, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x    , 12, 2, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x + 2, 12, 3, 1, matrix.Color333(0, 5, 0));

  matrix.drawRect(x - 7, 13, 6, 1, matrix.Color333(7, 1, 0));
  matrix.drawRect(x - 1, 13, 1, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x    , 13, 3, 1, matrix.Color333(0, 5, 0));
  matrix.drawRect(x + 3, 13, 1, 1, matrix.Color333(7, 1, 0));

  matrix.drawRect(x - 6, 14, 5, 1, matrix.Color333(5, 5, 5));
  matrix.drawRect(x + 1, 14, 3, 1, matrix.Color333(7, 1, 0));

  matrix.drawRect(x + 1, 15, 3, 1, matrix.Color333(7, 1, 0));
}


void loop() {
  // put your main code here, to run repeatedly:

 ble_do_events();

if ( ble_available() )
  {
    while ( ble_available() )
    {
      Serial.write(ble_read());
    }
    
    Serial.println();
  }
  
  matrix.fillScreen(0);
  Serial.println("point 3");
  x= (matrix.width() /2);

  drawFrameOne(x);

  matrix.swapBuffers(false);
  delay(500);
}

}

You have not posted enough information for anyone to answer your questions.

Sounds like a power issue to me.

Have you connected the grounds?
How is everything wired up?

Hi,
thanks again,

So I have the main board running from my computer (over USB) and I have the board being powered via a separate switching power supply.

This is the BLE shield

as you can see it just clips to the Arduino and allows you to use pins

And here is the LED Matrix (I am using the 16x32)

To connect the matrix to the Arduino I followed this
tutorial

Sorry, just in case it is not clear, I have the Arduino being powered over USB, and I have the LED matrix being powered by this power supply

Thanks

Adafruit states:

A single 32x16 or 32x32 RGB matrix, running full tilt (all pixels set white), can require nearly 4 Amps of current! Double that figure for a 64x32 matrix. On average though, displaying typical graphics and animation, these panels will use less…a 2A supply is usually sufficient for a single 32x16 or 32x32 panel, or 4A for a 64x32 panel.

What voltage and amperage is your power supply set to?

Also, can you get the LED matrix to work without the Bluetooth shield?
Maybe there is a pin conflict.