RGB Matrix and RTC DS3231 problem

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mpt
 
Posts: 1
Joined: Thu Feb 08, 2018 3:14 am

RGB Matrix and RTC DS3231 problem

Post by mpt »

Hello,
On Arduino Nano I want display time on 32x32 led panel from RTC DS3231 module. When i run example from AdaFruit RGBmatrixPanel testshapes_32x32 everything is ok
but when i add RTC library

Code: Select all

#include <Wire.h>
#include <DS3231.h>
program don't work, led panel display only random pixels. When i comment RTC code, program displays on panel correctly. I notice also that when i uncomment DS3231 libraries (include) only, program not work properly again. Where is the problem?

Code: Select all

#include <Wire.h>
#include <DS3231.h>
#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

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

RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);
 
//DS3231 clock;
//RTCDateTime dt;
 
void setup()
{
  matrix.begin();
  
  //Serial.begin(9600);
  //Inicjalizacja DS3231
  //Serial.println("Initialize DS3231");;
  //clock.begin();
 
  // Ustawiamy date i czas z kompilacji szkicu
  //clock.setDateTime(__DATE__, __TIME__);
 
  // Lub recznie (YYYY, MM, DD, HH, II, SS
  // clock.setDateTime(2014, 4, 13, 19, 21, 00);

  
}
 
void loop()
{
  // Odczytujemy czas i formatujemy za pomoca funkcji dateFormat
  //dt = clock.getDateTime();
  //Serial.println(clock.dateFormat("H:i:s", dt));
  
  matrix.fillScreen(matrix.Color333(0, 0, 0));
  delay(1000);
  
  matrix.setCursor(1, 0);    // start at top left, with one pixel of spacing
  matrix.setTextSize(1);     // size 1 == 8 pixels high
  matrix.setTextWrap(false); // Don't wrap at end of line - will do ourselves

  matrix.setTextColor(matrix.Color333(7,7,7));
  matrix.println("Test");
  delay(1000);
  ;
}

User avatar
AdriaanHeijnen
 
Posts: 2
Joined: Fri Mar 02, 2018 9:14 am

Re: RGB Matrix and RTC DS3231 problem

Post by AdriaanHeijnen »

i have the same problem when using the following code.

#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
//#include <Wire.h>
//#include "RTClib.h"

including one or both gives random results.

Also when using serial for testing the RGB sometimes stops the working. can this be caused by multiple interupts?

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

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”