Hi Support.
I’m trying to connect the MeLEDMatrix 8x16 to a megapi (not PRO) board.
This is my stuff:
.- MeLEDMatrix
.- MeMegaPi
.- RJ25 to dupond wire (makeblock one).
According to my notes, the MeLEDMatrix communicates using I2C and it has these signals:
DIN (Data - SDA)
SCK (Clock - SCL)
5V
GND
NC
NC
The Megapi board has the SCL & SDA which are equivalents to Arduino mega 20(SDA) & 21(SCL), and are near to TX2 and RX2 pins
[SCL][SDA] <- I’ll use these I2C pins
[TX2][RX2]
The RJ25 to dupont wire has these colors
White
Black
Red
Green
Yellow
Blue
And this is how I connect the Matrix and the megapi board:
LED WIRE MEGAPI
DIN > white > SDA
SCK > black > SCL
5V > red > any red pin near to A6 pin
GND > green > any black pin near to A6 pin
nc not connected
nc not connected
As there are no port to use I2C in the Megapi board, I use arduino mega pins 20-SDA & 21-SCL equivalent.
this is my sample program in arduino IDE:
#include <MeMegaPi.h>
#include <MeLEDMatrix.h>
MeLEDMatrix ledMx(21,20);
void setup()
{
ledMx.setBrightness(6);
ledMx.setColorIndex(1);
}
char *s = “AB”;
void loop()
{
ledMx.showClock(12,03,1);
delay(2000);
ledMx.drawStr(0,7,s);
delay(2000);
ledMx.showNum(1.23);
delay(2000);
}
But… I cannot make it work .
Is this wiring schema OK ?
In the program, it is ok to use pins 20 & 21 using this instruction MeLEDMatrix ledMx(21,20); ?
Thansk a lot in advance.