Why the LED Matrix does not lit up?
I have the below diagram wired up but the LED Matrix is not active at all (no blink no nothing, never lit up).
The dashed light Blue (SDA on B5) and Orange (SCL on B6) lines represents my second try when I connected the LED Matrix on the GSM Breakout and not directly on the GSM-BLE module (I do prefer to use them on the GSM-BLE module and not on the breakout)
I am using Arduino IDE and this are the included library’s and code (below)
#include <TinyWireM.h>
#include “Adafruit_LEDBackpack.h”
#include “Adafruit_GFX.h”
@dbelam
you told me this previously:
what are you saying is related with the I2C library? - #include <TinyWireM.h> (this is written by Adafruit for Trinket and Gemma modules specially)
I do have all this working on Adafruit Flora with the below code but I want to port it on the RePhone with Arduino.
If the I2C library is the issue, then will the LLedMatrix.h written by Seeed for their Xsadow LED work?
https://github.com/WayenWeng/RePhone_API_for_Arduino/blob/master/LLedMatrix.h
Thank you! for any help
[code]/*
This example code is in the public domain.
http://arduino.cc/en/Tutorial/ButtonStateChange
*/
#include <TinyWireM.h>
#include “Adafruit_LEDBackpack.h”
#include “Adafruit_GFX.h”
const int buttonPin = D3; // button pin set on GSM Breakout pad A1
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
// Variables will change:
int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
void setup() {
// initialize the button pin as a input:
pinMode(buttonPin, INPUT);
matrix.begin(0x70); // pass in the address
}
static const uint8_t PROGMEM // X and square bitmaps
hearth_bmp =
{ B00111100,
B01000010,
B10100101,
B10000001,
B10100101,
B10011001,
B01000010,
B00111100 },
smile_bmp =
{ B00100100,
B01011010,
B10011001,
B10000001,
B10000001,
B01000010,
B00100100,
B00011000 },
flower_bmp =
{ B11000011,
B10100101,
B01100110,
B00011000,
B01111011,
B10101110,
B11001100,
B00001000 };
void loop() {
// read the pushbutton input pin:
buttonState = digitalRead(buttonPin);
// compare the buttonState to its previous state
if (buttonState != lastButtonState) {
// if the state has changed, increment the counter
if (buttonState == HIGH && lastButtonState == LOW) {
// if the current state is HIGH then the button
// went from off to on:
buttonPushCounter++;
} else {
// if the current state is LOW then the button
// went from on to off:
}
}
// save the current state as the last state,
//for next time through the loop
lastButtonState = buttonState;
// turns on the LED every four button pushes by
// checking the modulo of the button push counter.
// the modulo function gives you the remainder of
// the division of two numbers:
if (buttonPushCounter % 4 == 0) {
matrix.clear();
matrix.drawBitmap(0, 0, hearth_bmp, 8, 8, LED_ON);
matrix.writeDisplay();
buttonState = HIGH;
if (buttonPushCounter % 1 == 0){
matrix.clear();
matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_ON);
matrix.writeDisplay();
buttonState = HIGH;
if (buttonPushCounter % 2 == 0){
matrix.clear();
matrix.drawBitmap(0, 0, flower_bmp, 8, 8, LED_ON);
matrix.writeDisplay();
buttonState = HIGH;
} else {
matrix.clear();
}
}
}
}[/code]