Need help with a very nice 2.2inch color graphics clok project.

Hello

Has anyone built this unique flip clock using a 2.2 inch color graphics display found at this website:
http://olganet.com/electro/2014/03/17/horloge-avec-afficheur-tft-2-2-240x320/
The host has done a nice job of posting the schematic and main code but does not say where we can get the specific include libraries he used.

The problem is; Im having trouble getting his code to compile.
I think the problem is with 2 of the libraries that I obtained from the Arduino github repository.
Im afraid that I don't know enough about Arduino C to get the RTClib and Button libraries working.

/**

  • Flip-Clock
  • Desinged for Arduino ATMEGA328P / TFT 2.2" 240x320 display
    **/
    #include <SPI.h> //working
    #include "Adafruit_GFX.h" //working
    #include "Adafruit_ILI9340.h" //working
    #include <Wire.h> //working
    #include <RTClib.h> // This library is giving me grief..not sure if I downloaded the right library. so far I have tried 4 downloads RCTClib.h and RTC.cpp.
    #include <Button.h> // This library is giving me grief.. not sure if I downloaded the right library. so far I have tried 14 downloads button.h and button.cpp.

I purchased all the parts for the project from Ebay. total cost so far $26.00
I have spent 18hrs trying different things.
I hope someone can shed some light on this project or tell me if I should just give up.

I don't know enough about arduino C to be able to to alter the libraries or, calls to the libraries to get it working.
I have left postings on the fellows web page but the host doesn't reply.

This is a example of one of the many errors I receive after compiling with Aduino IDEv 105r2 . I also tried using versions 00018 thru 0022 with no luck.

flipclknewlibrys:75: error: variable or field 'handleButtonReleaseEvents' declared void
flipclknewlibrys:75: error: expected primary-expression before ')' token
flipclknewlibrys:76: error: variable or field 'handleButtonHoldEvents' declared void
flipclknewlibrys:76: error: expected primary-expression before ')' token
flipclknewlibrys:69: error: expected unqualified-id before '=' token
flipclknewlibrys.ino: In function 'void setup()':
flipclknewlibrys:93: error: expected primary-expression before '.' token
flipclknewlibrys:93: error: 'handleButtonReleaseEvents' was not declared in this scope
flipclknewlibrys:94: error: expected primary-expression before '.' token
flipclknewlibrys:94: error: 'handleButtonHoldEvents' was not declared in this scope

Thanks

shortened version of Original code from the hosts web page:
/**

  • Flip-Clock
  • Desinged for Arduino ATMEGA328P / TFT 2.2" 240x320 display
    **/
    #include <SPI.h>
    #include "Adafruit_GFX.h"
    #include "Adafruit_ILI9340.h"
    #include <Wire.h>
    #include <RTClib.h>
    #include <Button.h>

// These are the pins used for the UNO
#define TFT_SCLK 13
#define TFT_MISO 12
#define TFT_MOSI 11
#define TFT_CS 5
#define TFT_DC 6
#define TFT_RST 4
#define TFT_BL_ON {DDRD |= 0x80;PORTD |= 0x80;}

#define WHITE tft.Color565(255,255,255)
#define BLACK tft.Color565(0,0,0)
#define RED tft.Color565(255,58,47)
#define GREEN tft.Color565(58,255,47)
#define BLUE tft.Color565(13,143,209)
#define YELLOW tft.Color565(209,193,13)
#define DARK_GRAY tft.Color565(40,40,40)
#define GRAY tft.Color565(60,60,60)
#define LIGHT_GRAY tft.Color565(150,150,150)

#define BUTTON1_PIN 9
#define BACKLIGHT_PIN 3
#define HOLD_DURATION 1000
#define SMALL_FONT 1
#define MEDIUM_FONT 2
#define BIG_FONT 3

extern uint8_t BigFont[];
extern uint8_t MediumFont[];
extern uint8_t SmallFont[];
extern uint8_t Symbol[];

RTC_DS1307 RTC;
Adafruit_ILI9340 tft = Adafruit_ILI9340(TFT_CS, TFT_DC, TFT_RST);
Button button1 = Button(BUTTON1_PIN,BUTTON_PULLDOWN);
boolean longPush = false;
byte value, etat, lastEtat = 0;
boolean forceRefresh = false;
byte dimCycle[4] = {30,60,120};
byte dimValue = 1;
int digitPos[4] = {10,82,172,244};
String dayNames[7] = {
"DIM","LUN", "MAR","MER","JEU","VEN","SAM"};
String monthNames[13] = {
"","JAN","FEV","MAR","AVR","MAI","JUN","JUI","AOU","SEP","OCT","NOV","DEC"};
String settingsStates[7] = {
"","Set clock hours (+)","Set clock minutes (+)","Set clock date (+)", "Set clock date (-)", "Set clock year (+)","Set clock year (-)"};

DateTime now;
byte lastHour, lastMinute, lastSecond, lastDay, lastTemp, temp = 0xFF;
int lastYear = 0;
boolean showDots = true;
int top = 23;

void setup() {
Wire.begin();
RTC.begin();

button1.releaseHandler(handleButtonReleaseEvents);
button1.holdHandler(handleButtonHoldEvents,HOLD_DURATION);

pinMode(BACKLIGHT_PIN, OUTPUT);
analogWrite(BACKLIGHT_PIN, dimCycle[dimValue]);
tft.begin();

tft.fillScreen(DARK_GRAY);
tft.setRotation(1);
//RTC.adjust(DateTime(DATE, TIME));
}

void loop(void) {

button1.isPressed();
now = RTC.now();

// Display hours
if (lastHour != now.hour() || forceRefresh) {
showDigit(digitPos[0], top, now.hour()/10, (etat == 1)?true:false);
showDigit(digitPos[1], top, now.hour()%10, (etat == 1)?true:false);
lastHour = now.hour();
}
// Display minutes
if (lastMinute != now.minute() || forceRefresh) {
showDigit(digitPos[2], top, now.minute()/10, (etat == 2)?true:false);
showDigit(digitPos[3], top, now.minute()%10, (etat == 2)?true:false);
lastMinute = now.minute();
}

// Display flashing dots
if (lastSecond != now.second()){
lastSecond = now.second();
drawDots(top); // 2 points
}

// Display temperature
temp = round(getTemperature());
if ((temp != lastTemp && temp >= 0 && etat == 0 ) || (etat == 0 && forceRefresh)) {
showTemp(digitPos[0]+160, top+121, temp);
lastTemp = temp;
}

// Display date
if (lastDay != now.day() || lastYear != now.year() || forceRefresh) {
showDate(digitPos[0], top+121, now.dayOfWeek(), now.day(), now.month(), now.year(), (etat > 2 && etat < 7)?true:false);
lastDay = now.day();
lastYear = now.year();
}

// Set time or date
if (value > 0) {
switch (etat) {

case 1: // Set hours
RTC.adjust(DateTime (now.year(), now.month(), now.day(), (now.hour() <23) ? now.hour()+1 : 0, now.minute(), 0));
break;

case 2: // Set minutes
RTC.adjust(DateTime (now.year(), now.month(), now.day(), now.hour(), (now.minute() <59) ? now.minute()+1 : 0, 0));
break;

case 3: // Set date + 1day
RTC.adjust(now.unixtime() + 86400);
break;

case 4: // Set date - 1day
RTC.adjust(now.unixtime() - 86400);
break;

case 5: // Set date + year
RTC.adjust(DateTime ((now.year() <2100) ? now.year()+1 : 2000, now.month(), now.day(), now.hour(), now.minute(), 0));
break;

case 6: // Set date - year
RTC.adjust(DateTime ((now.year() >2000) ? now.year()-1 : 2000, now.month(), now.day(), now.hour(), now.minute(), 0));
break;

}
value = 0;
}

forceRefresh = false; // cancel forceRefresh
if (lastEtat != etat ) {
tft.fillScreen(DARK_GRAY);
showDebug(settingsStates[etat]);
forceRefresh = true; // force refresh
lastEtat = etat;
}
// delay(10);
}

// ---------------------------------- Fonctions ---------------------------------- //
void drawDots(int y) {
tft.fillRect(155, y+23, 10, 10, (showDots) ? DARK_GRAY : WHITE);
tft.fillRect(155, y+73, 10, 10, (showDots) ? DARK_GRAY : WHITE);
showDots = !showDots;
}

void showDigit(int x, int y, int number, boolean isSet) {
drawFlap(x, y, 66, 102, 20, 2);
showCar(x+9, y+12 , number, BIG_FONT, (isSet)?GREEN:WHITE, GRAY);
}

}

diagramme_horloge_tft_22-300x225.jpg

If you are using the RTC1307 board, you should use the RTClib from Adafruit, GitHub - adafruit/RTClib: A fork of Jeelab's fantastic RTC Arduino library.

The button library is probably from the Arduino Playground, GitHub - tigoe/Button: A fork of Alexander Brevig's Button library for Arduino

The link you provided is also missing the fonts, Google Code Archive - Long-term storage for Google Code Project Hosting..
Or you can use the file attached below.

TFT_Flip_Clock.zip (8.58 KB)

Thanx hiduino

I got everything working.

How did you manage to find those files?
I searched High and Low for days and always came up empty handed.

For anyone else building this project; I should pass along 2 notes:

(A) I had to REMOVE the RoboControl folder from my Arduino 105r2 ver or else the compiler would always give me void RoboControl errors. Due to a very strange problem relating to the wire library and and one of the other project libraries.

(B) I had to step back through the arduino-misc - servers path Source path: svn/trunk/projects/tiny_altimeter/libs.zip -to get to another project that was stored there. This other project is called tiny-altimeter and has included in its folder a libs.zip file, which has the only Button file that worked for me.
No other Button library file would work without void ReleaseHandel and PullupResistor compiler errors.

The Github RTClib library file seen in the previous post worked just fine.

The other 2 needed library files were downloaded from Adafruit
Adafruit_GFX
AdafruitILI9340

Also note: all the mentioned libraries must be dropped into the Arduino 105r2 Library folder, and NOT into the 2nd arduino Library folder found in your Documents folder (Windows users).

Thanks again
Your a life saver.

PS
Where is the compiled hex file placed/hidden on a windows PC.
Its not in the sketch folder. older versions 0014 used to place it with in the arduino directory or the document folder.

PS
Where is the compiled hex file placed/hidden on a windows PC.
Its not in the sketch folder. older versions 0014 used to place it with in the arduino directory or the document folder.

For Windows, The HEX is in a subdirectory under %temp%
If you use the Arduino GUI with the output set to verbose mode, you will see the directory after compiling.

Ray

codebuster:
Has anyone built this unique flip clock using a 2.2 inch color graphics display found at this website:

No, but it's cool.

Hello . Has anyone built this beautiful clock and would like to send me the complete code
Greeting Matthias from Germany

Hello! I return to this project periodically. I can not compile this sketch. I tried different IDE programs. Does anyone have a ready-made file with the extension .hex? Lay out please!