Arduino Regelung |
|
1 2 3 4
|
08.03.2016 16:05
plataaaa
|
Re: Arduino Regelung
ach übrigens, wenn Du °C ausgeben willst, musst Du das mit \337C machen. am LCD sind Umlaute usw... eigens programmiert, bei meinem z.B. wird der Umlaut ü mit dem Code \365 angezeigt und ein ä mit \344 es gibt beim Hersteller ein Übersichtsblatt für diese Zeichen, beim Hitachi z.B. https://www.adafruit.com/datasheets/HD44780.pdf
|
|
|
08.03.2016 16:05
plataaaa
|
Re: Arduino Regelung
wieder vergessen, am Datenblatt auf S. 17 und 18
|
|
|
08.03.2016 16:21
plataaaa
|
Re: Arduino Regelung
bzgl. deinem Code hab ich mir den ein wenig genauer angeschaut, die anzeige funzt so nicht ganz. deine kpl. if kannst du ersetzen gegen einen switch: lcd.setCursor(0,0); // set the cursor to column 0, line 0 switch(anzeige){ case 0: lcd.print("Zulufttemp"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; case 1: lcd.print("Aussentemp"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; case 2: lcd.print("Kellertemp"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; case 3: lcd.print("Kollektortemp"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; } lcd.setCursor(11,1); // set the cursor to column 0, line 1 lcd.print(" \337C");
|
|
|
08.03.2016 19:14
Highway
|
Re: Arduino Regelung
Danke Plataaaa, habe es schon testen können Regler neu ist da und läuft schon wie ich wollte aber danke für die Kürzung des Codes!
Wann wird es endlich wieder Sonnig?
Highway
|
|
|
08.03.2016 21:54
Highway
|
Re: Arduino Regelung
So nochmal für alle getestet und für gut empfunden.
#include <OneWire.h> #include <DallasTemperature.h> #include <LiquidCrystal.h> #include <Wire.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(4, 6, 10, 11, 12, 13); /**********************************************************/ #define ONE_WIRE_BUS 7 // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) OneWire oneWire(ONE_WIRE_BUS); // Pass our oneWire reference to Dallas Temperature. DallasTemperature sensors(&oneWire); const int keyPin = 8; //the number of the key pin int anzeige = 0; /**********************************************************/ void setup() { // start serial port Serial.begin(9600); // Serial.println("Dallas Temperature IC Control Library Demo"); // Start up the library sensors.begin(); lcd.begin(16, 2); // set up the LCD's number of columns and rows: pinMode(keyPin,INPUT);//initialize the key pin as input }
void loop() { /************************** Taster fuer Anzeige ********************************/ if(digitalRead(keyPin) ==HIGH ) { anzeige = (anzeige +1);//Anzeige umschalten delay(1500);//Warten damit der Finger wech kommt } if((anzeige) == 4) { anzeige = 0; } /************************** Sensor ********************************/ // call sensors.requestTemperatures() to issue a global temperature // request to all devices on the bus //Serial.print("Requesting temperatures..."); sensors.requestTemperatures(); // Send the command to get temperatures // Serial.println("DONE"); /************************* LCD *********************************/ lcd.setCursor(0,0); // set the cursor to column 0, line 0 switch(anzeige){ case 0: lcd.print("Zulufttemp "); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; case 1: lcd.print("Aussentemp"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; case 2: lcd.print("Kellertemp"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; case 3: lcd.print("Kollektortemp"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("Temp: "); lcd.print(sensors.getTempCByIndex(anzeige)); // Print temp 0 to the LCD. break; } lcd.setCursor(11,1); // set the cursor to column 0, line 1 lcd.print(" \337C"); }
Und jetzt muss der Datenwust noch auf meinen Server hochgeladen werden damit ich von der Arbeit aus sehen kann wie er läuft. Dafür habe ich auch schon was gefunden http://jleopold.de/2011/03/16/arduino-da...gger-mysql-php/ da müsste alles sein was ich brauche, muss mir nur noch die Programme und die Datenbank aufbauen am Server.
Wann wird es endlich wieder Sonnig?
Highway
|
|
|
12.03.2016 09:18
Highway
|
Re: Arduino Regelung
Hi Plataaaa, hättest du mal einen codeschnipsel für Netzwerk und Datenübertragung welche funktioniert. Bekomme hier die Datenübertragung nicht ans Laufen. Datenbank funktioniert schon http://logger.horbach-in-franken.de/show_data.php sind noch Testwerte.
Wann wird es endlich wieder Sonnig?
Highway
|
|
|
14.03.2016 09:35
plataaaa
|
Re: Arduino Regelung
void send_request (int t, int h) { // Anfrage senden if (client.connected()) { client.fastrprint(F("GET ")); client.fastrprint(WEBPAGE); client.fastrprint(F("?private_key=")); client.fastrprint(privateKey); client.fastrprint("&temp="); client.print(t); client.fastrprint("&hum="); client.print(h); client.fastrprint(F(" HTTP/1.1\r\n")); client.fastrprint(F("Host: ")); client.fastrprint(WEBSITE); client.fastrprint(F("\r\n")); client.println(); } else { Serial.println(F("Verbindung fehlgeschlagen")); } // Antwort vom Server ausgeben while (client.connected()) { while (client.available()) { char c = client.read(); Serial.print(c); } // Verbindung zum Server schließen Serial.println(F("Verbindung geschlossen")); Serial.println(); } client.close(); }
wobei t und h für temperatur und luftfeuchte steht. diese prozedur einfach im code dann aufrufen.
|
|
|
14.03.2016 22:24
Highway
|
Re: Arduino Regelung
Danke plataaaa, hab es jetzt am laufen, war das Gateway was fehlte!
Jetzt noch ne Fritze 7330 als Repeater mit drann und ab in den Keller, morgen Abend gehts los.
Wann wird es endlich wieder Sonnig?
Highway
|
|
|
|
15.03.2016 07:55
KapHorn
|
Re: Arduino Regelung
Hej Highway
|
|
|
|
1 2 3 4
|