Hallo,
Ich möchte ein Nokia 5110 Display und eine SD Karte über ein Mega board betreiben.
Leider zeigt mir das Display nichts an.
#include <SD.h>
#include <LCD5110_Basic.h>
const int chipSelect = 53;
float datalog = 0;
float datalogalt = 0;
int value = 10;
LCD5110 myGLCD(52,51,49,48,46);
extern uint8_t SmallFont[];
extern uint8_t MediumNumbers[];
extern uint8_t BigNumbers[];
void setup(){
Serial.begin(9600);
Serial.print("Initializing SD card...");
// make sure that the default chip select pin is set to
// output, even if you don't use it:
pinMode(53, OUTPUT);
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
Serial.println("card initialized.");
myGLCD.InitLCD();
}
void loop(){
datalog = millis();
if((datalog - datalogalt) >=6000){
File dataFile = SD.open("test.txt", FILE_WRITE);
if (dataFile) {
dataFile.println(value);
dataFile.close();
// print to the serial port too:
Serial.println(value);
datalogalt = datalog;
value --;
}
else {
Serial.println("error opening test.txt");
}
}
myGLCD.setFont(SmallFont);
myGLCD.invertText(true);
myGLCD.print("Start", LEFT,0);
Serial.println("Hallo");
}