Hallo,
Ich bin neu in der Arduino welt, hab mir schon ein bisschen was angeeignet mit büchern und so, aber komm nicht wirklich weiter jetzt, also:
Hab das Problem dass ich nen error bekomme bein Schreiben einer Temperatur auf das 3,2 LCD display
Hier der Sketch
#include <UTFT.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 8
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress motorThermometer = { 0x28, 0x15, 0x52, 0xDD, 0x03, 0x00, 0x00, 0xC0 };
DeviceAddress aussenThermometer = { 0x28, 0x93, 0x24, 0xDD, 0x03, 0x00, 0x00, 0x69 };
DeviceAddress oeltempThermometer = { 0x28, 0x59, 0xBE, 0xDF, 0x02, 0x00, 0x00, 0x9F };
// Declare which fonts we will be using
extern uint8_t SmallFont[];
UTFT myGLCD(ITDB32S,38,39,40,41);
void setup(void)
{
randomSeed(analogRead(0));
// Setup the LCD
myGLCD.InitLCD(LANDSCAPE);
myGLCD.setFont(SmallFont);
myGLCD.clrScr();
{
// start serial port
Serial.begin(9600);
// Start up the library
sensors.begin();
// set the resolution to 10 bit (good enough?)
sensors.setResolution(motorThermometer, 10);
sensors.setResolution(aussenThermometer, 10);
sensors.setResolution(oeltempThermometer, 10);
}
}
void printTemperature(DeviceAddress deviceAddress)
{
float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
Serial.print("Error getting temperature");
} else {
Serial.print("C: ");
Serial.print(tempC);
Serial.print(" F: ");
Serial.print(DallasTemperature::toFahrenheit(tempC));
}
}
void loop()
{
//int buf[318];
//int x, x2;
//int y, y2;
//int r;
// Clear the screen and draw the frame
//myGLCD.clrScr();
myGLCD.setColor(255, 0, 0);
myGLCD.fillRect(0, 0, 319, 13);
myGLCD.setColor(64, 64, 64);
myGLCD.fillRect(0, 226, 319, 239);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("* Blonders Arduino *", CENTER, 1);
myGLCD.setBackColor(64, 64, 64);
myGLCD.setColor(255,255,0);
myGLCD.print("Projekt V 0.1 Fuehler Anzeiger", CENTER, 227);
myGLCD.setColor(0, 0, 255);
myGLCD.drawRect(0, 14, 319, 225);
// Draw crosshairs
myGLCD.setColor(0, 0, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.drawLine(159, 15, 159, 224);
myGLCD.drawLine(1, 119, 318, 119);
for (int i=9; i<310; i+=10)
myGLCD.drawLine(i, 117, i, 121);
for (int i=19; i<220; i+=10)
myGLCD.drawLine(157, i, 161, i);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
//myGLCD.print("That's it!", CENTER, 93);
//myGLCD.print("Restarting in a", CENTER, 119);
//myGLCD.print("few seconds...", CENTER, 132);
myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 255);
myGLCD.print("Runtime: (msecs)", CENTER, 210);
myGLCD.printNumI(millis(), CENTER, 225);
myGLCD.setColor(0,255,255);
//myGLCD.print("Hallo", CENTER, 93);
//myGLCD.print("Nicole", CENTER, 119);
//test
printTemperature(motorThermometer);
myGLCD.print(motorThermometer 0, 0);
{
delay(2000);
Serial.print("Getting temperatures...\n\r");
sensors.requestTemperatures();
Serial.print("Motor Temperatur ist: ");
printTemperature(motorThermometer);
Serial.print("\n\r");
Serial.print("Aussen Temperatur ist: ");
printTemperature(aussenThermometer);
Serial.print("\n\r");
Serial.print("Oelt Temperatur is: ");
printTemperature(oeltempThermometer);
Serial.print("\n\r\n\r");
}
delay (0);
}
Fehlermeldung:
F_hler_V0_1.ino: In function 'void loop()':
F_hler_V0_1:114: error: expected `)' before numeric constant
F_hler_V0_1:114: error: no matching function for call to 'UTFT::print(uint8_t [8], int)'
C:\Users\Blonder\Desktop\programme\Arduino\Arduino 1.0.5\libraries\UTFT/UTFT.h:140: note: candidates are: void UTFT::print(char*, int, int, int)
C:\Users\Blonder\Desktop\programme\Arduino\Arduino 1.0.5\libraries\UTFT/UTFT.h:141: note: void UTFT::print(String, int, int, int)
Normal Schreiben kann ich auf das Display, nur die ausgelesenen Temperaturen nicht
Benützt wird ein: Mega 2560, Sainsmart 3,2 TFT Touch, mit 3 Dallas DS1820 Fühler
Bitte um hilfe