Hey All,
As stated, I am using the Charlieplexing library from the LolShield ( slightly modified for only 72 LEDs -- I am NOT using the LoLShield) and a Chronodot DS3231 RTC.
When I call the req'd "LedSign::Init()" in the void.setup(), it seems the sketch crashes.
In the example below, when the LedSign::Init is commented out, The Serial Monitor shows:
init command before the fouling Init
made it command following the fouling (but commented out) Init
get time the proper operations in the loop()
...
... and works properly (it won;t show every second, as there are a number of debugging delay() statements)
When LedSign::Init() is active, all I get in the serial monitor is:
init command before the fouling Init
...
(chirping crickets)
...
I posed this question on the Adafruit website here: Chronodot and LoL Shield conflict HELP! - adafruit industries and I got alot of thought-provoking suggestions, but nothing that yielded any result.
The code below is a test sketch written by Eric Ayars for his DS3231 library - which is cleanly written and from what I know, the most comprehensive library for the Chronodot . (Thanks for his great work) I emailed him, and he replied in about 30 minutes - gotta love that! The issue isn't with his sketch or library.
More below the code...
Here is the test sketch:
/*
DS3231_test.pde
Eric Ayars
4/11
Test/demo of read routines for a DS3231 RTC.
Turn on the serial monitor after loading this to check if things are
working as they should.
*/
#include <DS3231.h>
#include <Wire.h>
#include <Charliplexing.h>
DS3231 Clock;
bool Century=false;
bool h12;
bool PM;
byte ADay, AHour, AMinute, ASecond, ABits;
bool ADy, A12h, Apm;
byte year, month, date, DoW, hour, minute, second;
void setup() {
// Start the serial interface
Serial.begin(9600);
delay(1000);
Serial.println(" init "); // <-- This prints, ++
delay(1000);
// LedSign::Init(); // <-- when this is enabled
delay(1000);
Serial.println("made it"); // <-- this doesn't print ++
delay(1000); // <-- Nothing after the LedSign command executes
// Start the I2C interface
Wire.begin();
}
void loop() {
// send what's going on to the serial monitor.
// Start with the year
Serial.print("get time"); delay(1000);
Serial.print('\n');
delay(1000);
// Display the time once more as a test of the getTime() function
Clock.getTime(year, month, date, DoW, hour, minute, second);
Serial.print(year, DEC);
Serial.print(month, DEC);
Serial.print(date, DEC);
Serial.print(DoW, DEC);
Serial.print(hour, DEC);
Serial.print(minute, DEC);
Serial.println(second, DEC);
}
The 2 libraries are to be found:
Chronodot -- http://physics.csuchico.edu/~eayars/code/DS3231.zip
Charlieplexing -- Google Code Archive - Long-term storage for Google Code Project Hosting.
Along the debugging process, I have:
-Cut out most of the above sketch's contents (dozens of read & print statements) - looking for memory issues
-Rolled back my otherwise functional changes in the Charlieplexing Library back to 126 LEDs - no luck.
-Used Charlieplexing Example code, and insterted Chronodot support - caused a similar crash - but I am going to dig deeper in that direction now, as I have been focused on the LedSign::Init() crashing the above sketch.
-Tried this on my Arduino Duemilanove and my Pro-Mini 328/5V/16Mhz each with a different Chronodot (testing Board and the breakout board at the same time I guess)
Yes, I know there are plenty of workarounds - everything from manipulating the pins within my sketch dumping the library to moving into PWM LED controllers (which is a good idea)
I would think that someone else has tried to combine the LoL Shield & Chronodot as they seem like a pretty natural fit.
Thanks in advance