Hi all,
I am using arduino nano with nokia 5110 display and rtc 3231. I meet with problem showing time on display.
code below is not working:
lcd.GotoXY(0,1);
lcd.LcdString(t.hour);
main.ino
#include <Nokia5110.h>
#include <DS3231.h>
#define RST 8
#define CE 7
#define DC 6
#define DIN 5
#define CLK 4
LCDnokia5110 lcd(RST, CE, DC, DIN, CLK);
int temp;
DS3231 rtc(SDA, SCL);
Time t;
void setup() {
Serial.begin(9600);
rtc.begin();
lcd.LcdInitialise();
lcd.LcdClear();
lcd.CharSpace = 1;
lcd.GotoXY(15,0);
lcd.LcdString("'C");
}
void loop() {
temp = rtc.getTemp();
t = rtc.getTime();
lcd.GotoXY(0,0);
lcd.LcdString(temp);
lcd.GotoXY(0,1);
lcd.LcdString(t.hour);
lcd.GotoXY(0,2);
lcd.LcdString(t.min);
lcd.GotoXY(0,3);
lcd.LcdString(t.sec);
}
nokia5110.h
#ifndef LCDnokia5110_h
#define LCDnokia5110_h
#include "Arduino.h"
class LCDnokia5110
{
public:
LCDnokia5110(int, int, int, int, int);
void LcdClear();
void LcdInitialise();
void LcdWrite(byte, byte);
void LcdString(char*);
void LcdCharacter(char character);
void GotoXY(int, int);
void ShowLogo(int);
void ShowImage(const unsigned char[], int);
int CharSpace;
private:
};
#endif
If something missing, write please. Thank you
.