Go Down

Topic: Projekt: LCDMenuLib / LCDMenuLib2 ( LCDML ) - Menü mit mehreren Ebenen  (Read 303023 times) previous topic - next topic

Jomelo

In diesem Thread geht es um mögliche Probleme mit der Lib und grobe Hilfestellungen. Ich kann dir so nicht helfen. Mach dazu bitte ein neues Thema auf.
In diesem Thread sind deine Fragen nicht richtig plaziert.

Zudem musst du deine Fragen nicht immer auf Englisch und Deutsch übersetzen. Das Englische kann man deutlich besser verstehen als das übersetzte Deutsch.
while(!success){try++;}

pyro2k8

Hallo,

ich möchte die Library gerne mit einem ESP8266 zusammen nutzen. Leider kann ich das Beispiel LCDML_031_i2c_display_20x4 nicht compilieren. Wahrscheinlich habe ich auch die falsche Version von der Library "LiquidCrystal_I2C"?!
Es kommen allerdings noch viele weitere Fehlermeldungen, mit denen ich nicht viel anfangen kann.  :(

Als Board habe ich den NodeMCU 1.0 ausgewählt. Vielleicht könnt ihr mal draufschauen. Danke!

Code: [Select]

Arduino: 1.8.5 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

WARNUNG: Bibliothek LiquidCrystal_I2C behauptet auf (avr) Architektur(en) ausgeführt werden zu können und ist möglicherweise inkompatibel mit Ihrem derzeitigen Board, welches auf (esp8266) Architektur(en) ausgeführt wird.

LCDML_031_i2c_display_20x4:31: error: 'POSITIVE' was not declared in this scope

   LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

                                                       ^

In file included from C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2.h:126:0,

                 from C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\examples\03_lcd\LCDML_031_i2c_display_20x4\LCDML_031_i2c_display_20x4.ino:16:

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:80:52: error: '_LCDML_DISP_cfg_max_string_length' was not declared in this scope

             char g_LCDML_DISP_lang_ ## name ##_var[_LCDML_DISP_cfg_max_string_length] = {content}

                                                    ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:100:9: note: in expansion of macro 'LCDML_LANG_DEF'

         LCDML_LANG_DEF(id, content); \

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:107:9: note: in expansion of macro 'LCDML_addAdvanced'

         LCDML_addAdvanced(id, parent, child, NULL, content, callback, 0, _LCDML_TYPE_default)       

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\examples\03_lcd\LCDML_031_i2c_display_20x4\LCDML_031_i2c_display_20x4.ino:70:3: note: in expansion of macro 'LCDML_add'

   LCDML_add         (0  , LCDML_0         , 1  , "Information"      , mFunc_information);       // this menu function can be found on "LCDML_display_menuFunction" tab

   ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:80:52: error: '_LCDML_DISP_cfg_max_string_length' was not declared in this scope

             char g_LCDML_DISP_lang_ ## name ##_var[_LCDML_DISP_cfg_max_string_length] = {content}

                                                    ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:100:9: note: in expansion of macro 'LCDML_LANG_DEF'

         LCDML_LANG_DEF(id, content); \

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:107:9: note: in expansion of macro 'LCDML_addAdvanced'

         LCDML_addAdvanced(id, parent, child, NULL, content, callback, 0, _LCDML_TYPE_default)       

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\examples\03_lcd\LCDML_031_i2c_display_20x4\LCDML_031_i2c_display_20x4.ino:71:3: note: in expansion of macro 'LCDML_add'

   LCDML_add         (1  , LCDML_0         , 2  , "Time info"        , mFunc_timer_info);        // this menu function can be found on "LCDML_display_menuFunction" tab

   ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:80:52: error: '_LCDML_DISP_cfg_max_string_length' was not declared in this scope

             char g_LCDML_DISP_lang_ ## name ##_var[_LCDML_DISP_cfg_max_string_length] = {content}

                                                    ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:100:9: note: in expansion of macro 'LCDML_LANG_DEF'

         LCDML_LANG_DEF(id, content); \

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:107:9: note: in expansion of macro 'LCDML_addAdvanced'

         LCDML_addAdvanced(id, parent, child, NULL, content, callback, 0, _LCDML_TYPE_default)       

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\examples\03_lcd\LCDML_031_i2c_display_20x4\LCDML_031_i2c_display_20x4.ino:72:3: note: in expansion of macro 'LCDML_add'

   LCDML_add         (2  , LCDML_0         , 3  , "Programme"        , NULL);                    // NULL = no menu function   

   ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:80:52: error: '_LCDML_DISP_cfg_max_string_length' was not declared in this scope

             char g_LCDML_DISP_lang_ ## name ##_var[_LCDML_DISP_cfg_max_string_length] = {content}

                                                    ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:100:9: note: in expansion of macro 'LCDML_LANG_DEF'

         LCDML_LANG_DEF(id, content); \

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:107:9: note: in expansion of macro 'LCDML_addAdvanced'

         LCDML_addAdvanced(id, parent, child, NULL, content, callback, 0, _LCDML_TYPE_default)       

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\examples\03_lcd\LCDML_031_i2c_display_20x4\LCDML_031_i2c_display_20x4.ino:73:3: note: in expansion of macro 'LCDML_add'

   LCDML_add         (3  , LCDML_0_3       , 1  , "Program 1"        , NULL);                    // NULL = no menu function 

   ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:80:52: error: '_LCDML_DISP_cfg_max_string_length' was not declared in this scope

             char g_LCDML_DISP_lang_ ## name ##_var[_LCDML_DISP_cfg_max_string_length] = {content}

                                                    ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:100:9: note: in expansion of macro 'LCDML_LANG_DEF'

         LCDML_LANG_DEF(id, content); \

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:107:9: note: in expansion of macro 'LCDML_addAdvanced'

         LCDML_addAdvanced(id, parent, child, NULL, content, callback, 0, _LCDML_TYPE_default)       

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\examples\03_lcd\LCDML_031_i2c_display_20x4\LCDML_031_i2c_display_20x4.ino:74:3: note: in expansion of macro 'LCDML_add'

   LCDML_add         (4  , LCDML_0_3_1     , 1  , "P1 dummy"         , NULL);                    // NULL = no menu function 

   ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:80:52: error: '_LCDML_DISP_cfg_max_string_length' was not declared in this scope

             char g_LCDML_DISP_lang_ ## name ##_var[_LCDML_DISP_cfg_max_string_length] = {content}

                                                    ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:100:9: note: in expansion of macro 'LCDML_LANG_DEF'

         LCDML_LANG_DEF(id, content); \

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:107:9: note: in expansion of macro 'LCDML_addAdvanced'

         LCDML_addAdvanced(id, parent, child, NULL, content, callback, 0, _LCDML_TYPE_default)       

         ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\examples\03_lcd\LCDML_031_i2c_display_20x4\LCDML_031_i2c_display_20x4.ino:75:3: note: in expansion of macro 'LCDML_add'

   LCDML_add         (5  , LCDML_0_3_1     , 2  , "P1 Settings"      , NULL);                    // NULL = no menu function 

   ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:80:52: error: '_LCDML_DISP_cfg_max_string_length' was not declared in this scope

             char g_LCDML_DISP_lang_ ## name ##_var[_LCDML_DISP_cfg_max_string_length] = {content}

                                                    ^

C:\Users\pyro2k8\Documents\Arduino\libraries\LCDMenuLib2\src/LCDMenuLib2_macros.h:100:9: note: in expansion of macro 'LCDML_LANG_DEF'

         LCDML_LANG_DEF(id, content); \

         ^




Ich kann nicht alles posten, zu viel Zeichen - gehe aber mal davon aus, dass eh vieles Folgefehler sind.
Vielen Dank für die Hilfe!

Gruß,
Tim

Jomelo

while(!success){try++;}

Mars018

Hey und erst mal ein herzliches hallo an alle.

Und als nächstes erst mal ein Danke für diese tolle Lib.

Und nun gleich mal ne frage und zwar nutze ich die alte lib davon die aktuellste für eine Steuerung einer standheizung und benzinpumpe.

Arduino nano (clone)
LCD 20x4 (ist eigentlich für ein ramps 1.4)
Drehencoder ist da mit drauf
2 relays Standard mit opto
Linearregler lmxxxx um aus 12 5 Volt zu machen

Problem ist das der lcd heute nach cirka 1,5 Stunden schlagartig garnix mehr angezeigt hat das Programm lief im Hintergrund normal weiter.
Nach einem reset hat er sofort wieder alles ganz normal angezeigt.

Gibt es da bekannte bugs ?
Speicherüberlauf oder ähnliches ?

Mit freundlichen Grüßen Marcus

Ps: mit dem schmartphone geschrieben

HotSystems

Gibt es da bekannte bugs ?
Speicherüberlauf oder ähnliches ?
1. Da wir deinen Sketch nicht kennen, keine Ahnung.
2. Siehe 1.
3. Evtl. Probleme mit deiner Spannungsversorgung.
Gruß Dieter

I2C = weniger ist mehr: weniger Kabel, mehr Probleme. 8)

postmaster-ino

Hi

Sehr wahrscheinlich ein Spannungsproblem oder die übertragenen Daten wurden verstümmelt.
Sobald das Display ein falsches Kommando bekommt (und dann halt ausführt), ist's Essig mit der Anzeige.
Dafür stehen die Lösungen allgemein noch aus - man kann aber das Display alle x Sekunden neu initialisieren - halt mit dem dann auffälligem Geflacker.
Oder, man versucht, das Display auszulesen (zugegeben: noch nie gemacht), wobei die übermittelten Zeichen wohl ebenfalls auch so im Display-Speicher ankommen, aber durch fehlerhafte Kommandos falsch angezeigt werden - kA, ob man den Zustand des Display auslesen kann, wäre mir aber nicht bekannt -  vll. ganz banal einen 'Display-Neu'-Knopf einbauen ...

MfG

Mars018

Hallo

Erst mal vielen dank für die schnellen Antworten.

Spannungsproblem habe ich auch schon überlegt aber mir fällt keine Lösung dafür ein sowas zu triggern.

Wie schaut es mit Kälte aus ? cirka 1*C

Das Display hat halt einfach garnix angezeigt so wie vor dem initialisieren kein müll kein garnix.



Code: [Select]

 #include <LiquidCrystal.h>
  #include <LCDMenuLib.h>
  #include <OneWire.h>
  #include <DallasTemperature.h>
  
  unsigned long initt = 20000;
  unsigned long buton_press = 250;
  unsigned long buton_rep = 0;
  
  int K1 = 11;
  int K2 = 12;

  int zustand = 1;
  int temperatur0 = 0;
  int temperatur1 = 0;
 


  int solltemperaturmin = 30;
  int solltemperaturmax = 35;


  unsigned long heizung_start = 0;           // startzeit der heizung
  unsigned long heizung_soll = 1800000;            // dauer heizphase
  long heizung_rest = 0;
  int heizung_minuten = 0;
  int heizung_sekunden = 0;
  char timebuffer_h[12];
  
  
  
  
  
  
  unsigned long cooldown_start = 0;          // startzeit abkühlphase
  unsigned long cooldown_soll = 600000;      // dauer abkühlphase
  long cooldown_rest = 0;
  int cooldown_minuten = 0;
  int cooldown_sekunden = 0;
  char timebuffer_c[12];
  
  unsigned long pumpe_start = 0;             // startzeit der pumpe
  int pumpe_value = 20;
  unsigned long pumpe_soll_on = 20000;           // dauer der pumpenphase ein
  unsigned long pumpe_soll_off = 600000;      // dauer der pumpenphase aus
  long pump_soll_off_rest = 0;
  int pump_soll_off_minuten = 0;
  int pump_soll_off_sekunden = 0;
  

  int pump = 0;
  int pumpe_test = 0;
  int stat = 1;                             // status der heizung 0=aus 1=ein 2=abkühlen


  
  int freigabe_benutzer = 0;
  int freigabe_heizung = 0;
  int freigabe_pumpe = 0;
  

  unsigned long starts = 0;               // anzahl der starts

  










  
  // lib config
  #define _LCDML_DISP_cfg_button_press_time          200    // button press time in ms
  #define _LCDML_DISP_cfg_scrollbar                  1      // enable a scrollbar
  #define _LCDML_DISP_cfg_cursor                     0x7E   // cursor Symbol
  #define _LCDML_DISP_cfg_initscreen_time            initt  // enable initscreen time
  
  #define ONE_WIRE_BUS 2 /* Digitalport Pin 2 definieren */
  
// *********************************************************************
// LCDML TYPE SELECT
// *********************************************************************
  // settings for lcd
  #define _LCDML_DISP_cols             20
  #define _LCDML_DISP_rows             4  

  // lcd object
  // liquid crystal needs (rs, e, dat4, dat5, dat6, dat7)
  LiquidCrystal lcd(3,4,5,6,7,8);
  OneWire ourWire(ONE_WIRE_BUS); /* Ini oneWire instance */
  DallasTemperature sensors(&ourWire);/* Dallas Temperature Library für Nutzung der oneWire Library vorbereiten */
  
  
  const uint8_t scroll_bar[7][8] = {
    {B10001, B10001, B10001, B10001, B10001, B10001, B10001, B10001}, // scrollbar top
    {B11111, B11111, B10001, B10001, B10001, B10001, B10001, B10001}, // scroll state 1
    {B10001, B10001, B11111, B11111, B10001, B10001, B10001, B10001}, // scroll state 2
    {B10001, B10001, B10001, B10001, B11111, B11111, B10001, B10001}, // scroll state 3
    {B10001, B10001, B10001, B10001, B10001, B10001, B11111, B11111}, // scrollbar bottom
    {B00000, B00000, B00001, B00010, B10100, B01000, B00000, B00000}, // Haken
    {B00000, B00000, B10001, B01010, B00100, B01010, B10001, B00000}  // kREUZ
    
    
};
 
 
 

// *********************************************************************
// LCDML MENU/DISP
// *********************************************************************
  // create menu
  // menu element count - last element id
  // this value must be the same as the last menu element
  #define _LCDML_DISP_cnt    21
  
  // LCDML_root        => layer 0
  // LCDML_root_X      => layer 1
  // LCDML_root_X_X    => layer 2
  // LCDML_root_X_X_X  => layer 3
  // LCDML_root_... => layer ...
  
  // LCDMenuLib_add     (id, group, prev_layer_element, new_element_num, lang_char_array, callback_function)
  // LCDMenuLib_addMenu (id, group, prev_layer_element, new_element_num, lang_char_array)
  // LCDMenuLib_addParam(id, group, prev_layer_element, new_element_num, lang_char_array, callback_function, parameter [0-255]) // needs LCDML_DISP_initParam
  
  //LCDML_DISP_init(_LCDML_DISP_cnt);
 LCDML_DISP_initParam(_LCDML_DISP_cnt);

  LCDML_DISP_addParam (0  , _LCDML_G2  , LCDML_root        , 1  , "Start"              , LCDML_FUNC_program_change, 0);
  LCDML_DISP_addParam (1  , _LCDML_G3  , LCDML_root        , 2  , "Stop"               , LCDML_FUNC_program_change, 1);
  
  LCDML_DISP_addMenu  (2  , _LCDML_G1  , LCDML_root        , 3  , "Einstellungen");
  LCDML_DISP_addMenu  (3  , _LCDML_G1  , LCDML_root        , 4  , "Statistik");
  LCDML_DISP_add      (4  , _LCDML_G1  , LCDML_root        , 5  , "Back"               , LCDML_FUNC_initscreen);

  
  LCDML_DISP_addMenu  (5  , _LCDML_G1  , LCDML_root_3      , 1  , "Temperatur");
  LCDML_DISP_add      (6  , _LCDML_G1  , LCDML_root_3_1    , 1  , "Min Temperatur"     , LCDML_FUNC_tmin);
  LCDML_DISP_add      (7  , _LCDML_G1  , LCDML_root_3_1    , 2  , "Max Temperatur"     , LCDML_FUNC_tmax);
  LCDML_DISP_add      (8  , _LCDML_G1  , LCDML_root_3_1    , 3  , "Back"               , LCDML_FUNC_back);
  
  LCDML_DISP_addMenu  (9  , _LCDML_G1  , LCDML_root_3      , 2  , "Zeit");
  LCDML_DISP_add      (10 , _LCDML_G1  , LCDML_root_3_2    , 1  , "Heiz Dauer"         , LCDML_FUNC_heiz_zeit_max);
  LCDML_DISP_add      (11 , _LCDML_G1  , LCDML_root_3_2    , 2  , "Abkuel Dauer"       , LCDML_FUNC_heiz_zeit_pause);
  LCDML_DISP_add      (12 , _LCDML_G1  , LCDML_root_3_2    , 3  , "Pumpe Dauer"        , LCDML_FUNC_pump_zeit_dauer);
  LCDML_DISP_add      (13 , _LCDML_G1  , LCDML_root_3_2    , 4  , "Pumpe Intervall"    , LCDML_FUNC_pump_zeit_intervall);
  LCDML_DISP_add      (14 , _LCDML_G1  , LCDML_root_3_2    , 5  , "Back"               , LCDML_FUNC_back);
 
  LCDML_DISP_addMenu  (15 , _LCDML_G1  , LCDML_root_3      , 3  , "Allgemein");
  LCDML_DISP_add      (16 , _LCDML_G1  , LCDML_root_3_3    , 1  , "Home Zeit"          , LCDML_FUNC_home_time);
  LCDML_DISP_add      (17 , _LCDML_G1  , LCDML_root_3_3    , 2  , "Tasten Erkennung"   , LCDML_FUNC_buton_press_time);
  LCDML_DISP_add      (18 , _LCDML_G1  , LCDML_root_3_3    , 3  , "Tasten Widerholung" , LCDML_FUNC_buton_rep_time);
  LCDML_DISP_add      (19 , _LCDML_G1  , LCDML_root_3_3    , 4  , "Back"               , LCDML_FUNC_back);
  
  LCDML_DISP_add      (20 , _LCDML_G1  , LCDML_root_3      , 4  , "Back"               , LCDML_FUNC_back);
  
  LCDML_DISP_add      (21 , _LCDML_G7  , LCDML_root        , 6  , "Home"               , LCDML_FUNC_initscreen); // in g7 => hidden
  
  
  
  
  LCDML_DISP_createMenu(_LCDML_DISP_cnt);


// *********************************************************************
// LCDML BACKEND (core of the menu, do not change here anything yet)
// *********************************************************************
  // define backend function  
  #define _LCDML_BACK_cnt    5  // last backend function id
  
  LCDML_BACK_init(_LCDML_BACK_cnt);
  // menu function and control function
  LCDML_BACK_new_timebased_dynamic (0  , ( 20UL )         , _LCDML_start  , LCDML_BACKEND_control);
  LCDML_BACK_new_timebased_dynamic (1  , ( 1000UL )       , _LCDML_stop   , LCDML_BACKEND_menu);  
  // custom backend function
  // static time example
  LCDML_BACK_new_timebased_static  (2  , ( 500UL )        , _LCDML_stop   , LCDML_BACKEND_auswertung);
  LCDML_BACK_new_timebased_static  (3  , ( 500UL )        , _LCDML_stop   , LCDML_BACKEND_steuerung);
  LCDML_BACK_new_timebased_dynamic (4  , ( 10000UL )      , _LCDML_stop   , LCDML_BACKEND_sensor);
  LCDML_BACK_new_timebased_static  (5  , ( 500UL )        , _LCDML_stop   , LCDML_BACKEND_pumpe);
  // dynamic time example
  
  LCDML_BACK_create();


  

  // Signals
  // ========
  // here are some signals defined
  /* beta 4
  LCDML_BACK_signal_init(2);
  LCDML_BACK_signal(0, signal_from_ping_to_pong);
  LCDML_BACK_signal(1, signal_from_pong_to_ping);
  */

// *********************************************************************
// SETUP
// *********************************************************************





Mars018

Und hier der Rest:

Code: [Select]


// *********************************************************************
// SETUP
// *********************************************************************
  void setup()
  { 
    // serial init; only be needed if serial control is used
    //while(!Serial);                    // wait until serial ready
    //Serial.begin(9600);                // start serial   
    //Serial.println(F(_LCDML_VERSION)); // only for examples
    sensors.begin();/* Inizialisieren der Dallas Temperature library */
    digitalWrite(K1, HIGH);
    digitalWrite(K2, HIGH);
 
 
    pinMode(K1, OUTPUT);
    pinMode(K2, OUTPUT);
     
   
   
    // LCD Begin
    lcd.begin(_LCDML_DISP_cols,_LCDML_DISP_rows); 
    // set special chars for scrollbar
    lcd.createChar(0, (uint8_t*)scroll_bar[0]);
    lcd.createChar(1, (uint8_t*)scroll_bar[1]);
    lcd.createChar(2, (uint8_t*)scroll_bar[2]);
    lcd.createChar(3, (uint8_t*)scroll_bar[3]);
    lcd.createChar(4, (uint8_t*)scroll_bar[4]);
    lcd.createChar(5, (uint8_t*)scroll_bar[5]);
    lcd.createChar(6, (uint8_t*)scroll_bar[6]);
   
    // Enable all items with _LCDML_G1 and _LCDML_G2
    LCDML_DISP_groupEnable(_LCDML_G1); // enable group 1
    LCDML_DISP_groupEnable(_LCDML_G2); // enable group 1
    // LCDMenu Setup
    LCDML_setup(_LCDML_BACK_cnt);
     
     LCDML_BACK_start(LCDML_BACKEND_auswertung);
     LCDML_BACK_start(LCDML_BACKEND_steuerung);
     LCDML_BACK_start(LCDML_BACKEND_sensor);
     LCDML_BACK_start(LCDML_BACKEND_pumpe);
  }

// *********************************************************************
// LOOP
// *********************************************************************
  void loop()
  {


    if((millis() - g_lcdml_initscreen) >= _LCDML_DISP_cfg_initscreen_time) {
      g_lcdml_initscreen = millis(); // reset init screen time
      LCDML_DISP_jumpToFunc(LCDML_FUNC_initscreen); // jump to initscreen     
    }
    // this function must called here, do not delete it
    LCDML_run(_LCDML_priority);
  }




// *********************************************************************
// check some errors - do not change here anything
// *********************************************************************
# if(_LCDML_DISP_rows > _LCDML_DISP_cfg_max_rows)
# error change value of _LCDML_DISP_cfg_max_rows in LCDMenuLib.h
# endif
# if(_LCDML_DISP_cols > _LCDML_DISP_cfg_max_string_length)
# error change value of _LCDML_DISP_cfg_max_string_length in LCDMenuLib.h
# endif



Backend:

Code: [Select]

// *********************************************************************
void LCDML_BACK_setup(LCDML_BACKEND_auswertung)
// *********************************************************************
{
  // setup
  // is called only if it is started or restartet (reset+start)
 // Serial.println(F("Setup: LCDML_BACKEND_static"));
  //Serial.println(F("==========================="));
 // Serial.println(stat);
  //Serial.println(freigabe_benutzer);
}
boolean LCDML_BACK_loop(LCDML_BACKEND_auswertung)
{
 
     
  if ((temperatur0 <= solltemperaturmin) && (stat == 1) && (freigabe_benutzer == 1)){
  stat = 2;
  freigabe_heizung = 1;
  freigabe_pumpe = 1;
  pumpe_test = 1;
  starts = starts + 1;
  heizung_start = millis();
  }

  if (((temperatur0 >= solltemperaturmax) && (stat == 2)) || ((millis() - heizung_start >= heizung_soll) && (stat == 2)) || ((freigabe_benutzer == 0) && (stat == 2))){
  stat = 3;
  freigabe_heizung = 0;
  freigabe_pumpe = 0;
  cooldown_start = millis();
  }
 
  if ((millis() - cooldown_start >= cooldown_soll) && (stat == 3)){
  stat = 1;
  }



 
 
  heizung_rest = heizung_soll - (millis() - heizung_start);
  heizung_rest=heizung_rest/1000;       // Alle ganzen Sekunden
  heizung_sekunden=heizung_rest%60;         // Sekunden
  heizung_rest=heizung_rest/60;         // Alle ganzen Minuten
  heizung_minuten=heizung_rest%60;         // Minuten

  cooldown_rest = cooldown_soll - (millis() - cooldown_start);
  cooldown_rest=cooldown_rest/1000;       // Alle ganzen Sekunden
  cooldown_sekunden=cooldown_rest%60;         // Sekunden
  cooldown_rest=cooldown_rest/60;         // Alle ganzen Minuten
  cooldown_minuten=cooldown_rest%60;         // Minuten
 
     
  //Serial.println(F("Auswertung"));
  //Serial.println(millis());
  //Serial.println(stat);
  //Serial.println(heizung_rest);
  //Serial.println(freigabe_benutzer);
  // return false = go to first backend function and check time
  return false;
  // return true = go to next backend function and check time
  // return true; 
}
void LCDML_BACK_stable(LCDML_BACKEND_auswertung)
{
  // stable stop
  // is called when a backend function is stopped with stopStable
  //Serial.println(F("Stop Stable: LCDML_BACKEND_static"));
  //Serial.println(F("=================================")); 
}



// *********************************************************************
void LCDML_BACK_setup(LCDML_BACKEND_steuerung)
// *********************************************************************
{
  // setup
  // is called only if it is started or restartet (reset+start)
 
}
boolean LCDML_BACK_loop(LCDML_BACKEND_steuerung)
{
     
  if ((freigabe_benutzer == 1) && (freigabe_heizung == 1)){
  digitalWrite(K1, LOW);
   
  }
  else {
  digitalWrite(K1, HIGH);

   
  }
  //Serial.println(F("Steuerung"));
  // return false = go to first backend function and check time
  return false;
  // return true = go to next backend function and check time
  // return true; 
}
void LCDML_BACK_stable(LCDML_BACKEND_steuerung)
{
  // stable stop
  // is called when a backend function is stopped with stopStable
 
}



// *********************************************************************
void LCDML_BACK_setup(LCDML_BACKEND_sensor)
// *********************************************************************
{
  // setup
  // is called only if it is started or restartet (reset+start)
  //Serial.println(F("Setup: LCDML_BACKEND_static"));
  //Serial.println(F("==========================="));
}
boolean LCDML_BACK_loop(LCDML_BACKEND_sensor)
{
  sensors.requestTemperatures(); // Temp abfragen
  //temperatur0 = sensors.getTempCByIndex(0);
  //temperatur1 = sensors.getTempCByIndex(1);
  //temperatur2 = sensors.getTempCByIndex(2);
  Serial.println(F("Sensor")); 
  Serial.println(LCDML_BACK_dynamic_getLoopTime(LCDML_BACKEND_sensor));

  temperatur0 = sensors.getTempCByIndex(0);
  ///Serial.print(temperatur0);
 



 
  // return false = go to first backend function and check time
  return true;
  // return true = go to next backend function and check time
  // return true; 
}
void LCDML_BACK_stable(LCDML_BACKEND_sensor)
{
  // stable stop
  // is called when a backend function is stopped with stopStable
   
}


// *********************************************************************
void LCDML_BACK_setup(LCDML_BACKEND_pumpe)
// *********************************************************************
{
  // setup
  // is called only if it is started or restartet (reset+start)
 
}
boolean LCDML_BACK_loop(LCDML_BACKEND_pumpe)
{
     
  if (((freigabe_pumpe == 1) && (millis() - pumpe_start >= pumpe_soll_off) && (pump == 0)) || (pumpe_test == 1)){
  digitalWrite(K2, LOW);
  pumpe_start = millis();
  pumpe_test = 0;
  pump = 1; 
  }

  if (((millis() - pumpe_start >= pumpe_soll_on)) || (freigabe_pumpe == 0)){
   digitalWrite(K2, HIGH);
   pump = 0;
  }

   
 
  //Serial.println(F("Pumpe"));
  // return false = go to first backend function and check time
  return false;
  // return true = go to next backend function and check time
  // return true; 
}
void LCDML_BACK_stable(LCDML_BACKEND_pumpe)
{
  // stable stop
  // is called when a backend function is stopped with stopStable
 
}

Mars018

So und Hier noch die Funk_Disp

Code: [Select]

// *********************************************************************
void LCDML_DISP_setup(LCDML_FUNC_back)
// *********************************************************************
{
  // setup
  // is called only if it is started
}
  
void LCDML_DISP_loop(LCDML_FUNC_back)
{
  // loop
  // is called when it is triggert
  LCDML_DISP_resetIsTimer(); // reset the initscreen timer
  LCDML.goBack();            // go back
  LCDML_DISP_funcend();      // LCDML_DISP_funcend calls the loop_end function
}
  
void LCDML_DISP_loop_end(LCDML_FUNC_back)
{
  // loop end
  // this functions is ever called when a DISP function is quit
  // you can here reset some global vars or do nothing
}




// *********************************************************************
void LCDML_DISP_setup(LCDML_FUNC_program_change)
// *********************************************************************
{
  // setup function

  // use parameter on menu init
  uint8_t param = LCDML_DISP_getParameter();
  switch(param)
  {
    case 0:   // enable program
      LCDML_DISP_groupDisable(_LCDML_G2); // disable group 2
      LCDML_DISP_groupEnable(_LCDML_G3); // enable group 3
      freigabe_benutzer = 1;
      
      break;

    case 1:
      LCDML_DISP_groupEnable(_LCDML_G2); // enable group 2
      LCDML_DISP_groupDisable(_LCDML_G3); // disable group 3
      freigabe_benutzer = 0;
      
      break;

    default:
      //get parameter errors
      break;
  }
  LCDML.goRoot(); // go to root element (first element of this menu with id=0)
}

void LCDML_DISP_loop(LCDML_FUNC_program_change)
{
  // loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
  // the quit button works in every DISP function without any checks; it starts the loop_end function
}

void LCDML_DISP_loop_end(LCDML_FUNC_program_change)
{
  // this functions is ever called when a DISP function is quit
  // you can here reset some global vars or do nothing  
}  




int tmax_value = 0; // button value counter (global variable)
void LCDML_DISP_setup(LCDML_FUNC_tmax)
// *********************************************************************
{
  tmax_value = solltemperaturmax;
  lcd.setCursor(0, 0);
  lcd.print(F("Maximal Temperatur"));  
  lcd.setCursor(7, 2); // set cursor  
  lcd.print(F("  c"));
}

void LCDML_DISP_loop(LCDML_FUNC_tmax)
{
  // loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
  // the quit button works in every DISP function without any checks; it starts the loop_end function
  
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      tmax_value--;
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      tmax_value++;
    }

      if (LCDML_BUTTON_checkEnter()) // check if button left is pressed
    {
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      
    }  
  }
  lcd.setCursor(7, 2); // set cursor  
  lcd.print(tmax_value); // print change content
  
}

void LCDML_DISP_loop_end(LCDML_FUNC_tmax)
{
solltemperaturmax = tmax_value;
}


// *********************************************************************
int tmin_value = 0; // button value counter (global variable)
void LCDML_DISP_setup(LCDML_FUNC_tmin)
// *********************************************************************
{
  tmin_value = solltemperaturmin;
  lcd.setCursor(0, 0);
  lcd.print(F("Minimale Temperatur"));  
  lcd.setCursor(7, 2); // set cursor  
  lcd.print(F("  c"));
}

void LCDML_DISP_loop(LCDML_FUNC_tmin)
{
  // loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
  // the quit button works in every DISP function without any checks; it starts the loop_end function
  
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      tmin_value--;
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      tmin_value++;
    }

      if (LCDML_BUTTON_checkEnter()) // check if button left is pressed
    {
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      
    }  
  }
  
   lcd.setCursor(7, 2); // set cursor  
  lcd.print(tmin_value); // print change content
}

void LCDML_DISP_loop_end(LCDML_FUNC_tmin)
{
solltemperaturmin = tmin_value;
}





// *********************************************************************
uint8_t initt_value = 10; // button value counter (global variable)
void LCDML_DISP_setup(LCDML_FUNC_home_time)
// *********************************************************************
{
  lcd.setCursor(0, 0);
  lcd.print(F("Home nach:"));  
  lcd.setCursor(1, 1); // set cursor
  lcd.print(F("    Sekunden"));
  lcd.setCursor(1, 1); // set cursor  
  lcd.print(initt_value); // print change content
}

void LCDML_DISP_loop(LCDML_FUNC_home_time)
{
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      initt_value--;
      lcd.setCursor(1, 1); // set cursor
      lcd.print(F("    Sekunden"));
      lcd.setCursor(1, 1); // set cursor  
      lcd.print(initt_value); // print change content
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      initt_value++;
      lcd.setCursor(1, 1); // set cursor
      lcd.print(F("    Sekunden"));
      lcd.setCursor(1, 1); // set cursor  
      lcd.print(initt_value); // print change content
    }

      if (LCDML_BUTTON_checkEnter()){
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      }  
  }
 }

void LCDML_DISP_loop_end(LCDML_FUNC_home_time)
{
  if (initt_value <= 9){initt_value = 10;}
  initt = initt_value*1000;
}



// *********************************************************************
long buton_press_value = 250; // button value counter (global variable)
void LCDML_DISP_setup(LCDML_FUNC_buton_press_time)
// *********************************************************************
{
  // setup function
  // print lcd content
  lcd.setCursor(0, 0);
  lcd.print(F("Bis zur Erkenn.:"));  
  
  // Reset Button Value
  //g_button_value = 0;
  lcd.setCursor(1, 1); // set cursor
  lcd.print(F("    Millisekunden"));
  lcd.setCursor(1, 1); // set cursor  
  lcd.print(buton_press_value); // print change content
}

void LCDML_DISP_loop(LCDML_FUNC_buton_press_time)
{
  // loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
  // the quit button works in every DISP function without any checks; it starts the loop_end function
  
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      buton_press_value = buton_press_value - 5;
      
      // update lcd content
      lcd.setCursor(1, 1); // set cursor
      lcd.print(F("    Millisekunden"));
      lcd.setCursor(1, 1); // set cursor  
      lcd.print(buton_press_value); // print change content
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      buton_press_value = buton_press_value + 5;
      
      // update lcd content
      lcd.setCursor(1, 1); // set cursor
      lcd.print(F("    Millisekunden"));
      lcd.setCursor(1, 1); // set cursor  
      lcd.print(buton_press_value); // print change content
    }

      if (LCDML_BUTTON_checkEnter()) // check if button left is pressed
    {
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      
    }  
  }
  
  
}

void LCDML_DISP_loop_end(LCDML_FUNC_buton_press_time)
{
  if (buton_press_value <= 99){
    buton_press_value = 100;
  }
  buton_press = buton_press_value;
}





Mars018

Der Rest:

Code: [Select]

// *********************************************************************
long buton_rep_value = 0; // button value counter (global variable)
void LCDML_DISP_setup(LCDML_FUNC_buton_rep_time)
// *********************************************************************
{
  // setup function
  // print lcd content
  lcd.setCursor(0, 0);
  lcd.print(F("Zwischen der erkenn.:"));  
  
  // Reset Button Value
  //g_button_value = 0;
  lcd.setCursor(1, 1); // set cursor
  lcd.print(F("    Millisekunden"));
  lcd.setCursor(1, 1); // set cursor  
  lcd.print(buton_rep_value); // print change content
}

void LCDML_DISP_loop(LCDML_FUNC_buton_rep_time)
{
  // loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
  // the quit button works in every DISP function without any checks; it starts the loop_end function
  
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      buton_rep_value = buton_rep_value - 2;
      
      // update lcd content
      lcd.setCursor(1, 1); // set cursor
      lcd.print(F("    Millisekunden"));
      lcd.setCursor(1, 1); // set cursor  
      lcd.print(buton_rep_value); // print change content
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      buton_rep_value = buton_rep_value + 2;
      
      // update lcd content
      lcd.setCursor(1, 1); // set cursor
      lcd.print(F("    Millisekunden"));
      lcd.setCursor(1, 1); // set cursor  
      lcd.print(buton_rep_value); // print change content
    }

      if (LCDML_BUTTON_checkEnter()) // check if button left is pressed
    {
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      
    }  
  }
  
  
}

void LCDML_DISP_loop_end(LCDML_FUNC_buton_rep_time)
{
 
  buton_rep = buton_rep_value;
}



// ***************************************************************************************************
char timebuffer_heizzeit_max[12];
long heizung_stellen = 0;
long heizung_stellen_neu = 0;
int heizung_sekunden_max = 0;
int heizung_minuten_max = 0;
void LCDML_DISP_setup(LCDML_FUNC_heiz_zeit_max)
// ***************************************************************************************************
{
  heizung_stellen_neu = heizung_soll;
  lcd.setCursor(0, 0);
  lcd.print(F("Heizzeit Maximum"));  
}

void LCDML_DISP_loop(LCDML_FUNC_heiz_zeit_max)
{
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      heizung_stellen_neu = heizung_stellen_neu - 10000;
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      heizung_stellen_neu = heizung_stellen_neu + 10000 ;
    }

      if (LCDML_BUTTON_checkEnter()){
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      }  
  }
  heizung_stellen = heizung_stellen_neu;
  heizung_stellen=heizung_stellen/1000;       // Alle ganzen Sekunden
  heizung_sekunden_max=heizung_stellen%60;         // Sekunden
  heizung_stellen=heizung_stellen/60;         // Alle ganzen Minuten
  heizung_minuten_max=heizung_stellen%60;         // Minuten
  snprintf(timebuffer_heizzeit_max,sizeof(timebuffer_heizzeit_max),"%02d:%02d",heizung_minuten_max,heizung_sekunden_max);
  lcd.setCursor(7, 2); // set cursor
  //lcd.print(F(" Zeit:"));  
  lcd.print(timebuffer_heizzeit_max); // print change content
 }
void LCDML_DISP_loop_end(LCDML_FUNC_heiz_zeit_max)
{
  //if (initt_value <= 9){initt_value = 10;}
  heizung_soll = heizung_stellen_neu;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




// ***************************************************************************************************
char timebuffer_cooldown_max[12];
long cooldown_stellen = 0;
long cooldown_stellen_neu = 0;
int cooldown_sekunden_max = 0;
int cooldown_minuten_max = 0;
void LCDML_DISP_setup(LCDML_FUNC_heiz_zeit_pause)
// ***************************************************************************************************
{
  cooldown_stellen_neu = cooldown_soll;
  lcd.setCursor(0, 0);
  lcd.print(F("Abkuelzeit:"));  
}

void LCDML_DISP_loop(LCDML_FUNC_heiz_zeit_pause)
{
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      cooldown_stellen_neu = cooldown_stellen_neu - 10000;
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      cooldown_stellen_neu = cooldown_stellen_neu + 10000 ;
    }

      if (LCDML_BUTTON_checkEnter()){
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      }  
  }
  cooldown_stellen = cooldown_stellen_neu;
  cooldown_stellen=cooldown_stellen/1000;       // Alle ganzen Sekunden
  cooldown_sekunden_max=cooldown_stellen%60;         // Sekunden
  cooldown_stellen=cooldown_stellen/60;         // Alle ganzen Minuten
  cooldown_minuten_max=cooldown_stellen%60;         // Minuten
  snprintf(timebuffer_cooldown_max,sizeof(timebuffer_cooldown_max),"%02d:%02d",cooldown_minuten_max,cooldown_sekunden_max);
  lcd.setCursor(7, 2); // set cursor
  //lcd.print(F(" Zeit:"));  
  lcd.print(timebuffer_cooldown_max); // print change content
 }
void LCDML_DISP_loop_end(LCDML_FUNC_heiz_zeit_pause)
{
  //if (initt_value <= 9){initt_value = 10;}
  cooldown_soll = cooldown_stellen_neu;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++







// ***************************************************************************************************
char timebuffer_pump_max[12];
long pump_stellen = 0;
long pump_stellen_neu = 0;
int pump_sekunden_max = 0;
int pump_minuten_max = 0;
void LCDML_DISP_setup(LCDML_FUNC_pump_zeit_intervall)
// ***************************************************************************************************
{
  pump_stellen_neu = pumpe_soll_off;
  lcd.setCursor(0, 0);
  lcd.print(F("Pumpenintervall:"));  
}

void LCDML_DISP_loop(LCDML_FUNC_pump_zeit_intervall)
{
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      pump_stellen_neu = pump_stellen_neu - 10000;
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      pump_stellen_neu = pump_stellen_neu + 10000 ;
    }

      if (LCDML_BUTTON_checkEnter()){
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      }  
  }
  pump_stellen = pump_stellen_neu;
  pump_stellen=pump_stellen/1000;       // Alle ganzen Sekunden
  pump_sekunden_max=pump_stellen%60;         // Sekunden
  pump_stellen=pump_stellen/60;         // Alle ganzen Minuten
  pump_minuten_max=pump_stellen%60;         // Minuten
  snprintf(timebuffer_pump_max,sizeof(timebuffer_pump_max),"%02d:%02d",pump_minuten_max,pump_sekunden_max);
  lcd.setCursor(7, 2); // set cursor
  //lcd.print(F(" Zeit:"));  
  lcd.print(timebuffer_pump_max); // print change content
 }
void LCDML_DISP_loop_end(LCDML_FUNC_pump_zeit_intervall)
{
  //if (initt_value <= 9){initt_value = 10;}
  pumpe_soll_off = pump_stellen_neu;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




Mars018

So und hier nun wirklich das Ende.

Gibt es hier eine bessere anerkannte Möglichkeit denn Code zu teilen?

sharehoster? Wenn ja wäre da ein Hinweis ganz lieb.


Code: [Select]


// *********************************************************************
//int pumpe_value = 10; // button value counter (global variable)
void LCDML_DISP_setup(LCDML_FUNC_pump_zeit_dauer)
// *********************************************************************
{
  lcd.setCursor(0, 0);
  lcd.print(F("Pumpen dauer:")); 
 
}

void LCDML_DISP_loop(LCDML_FUNC_pump_zeit_dauer)
{
  if (LCDML_BUTTON_checkAny()) // check if any button is pressed (enter, up, down, left, right)
  {
    if (LCDML_BUTTON_checkUp()) // check if button left is pressed
    {
      LCDML_BUTTON_resetUp(); // reset the left button
      pumpe_value--;
    }

    if (LCDML_BUTTON_checkDown()) // check if button right is pressed
    {
      LCDML_BUTTON_resetDown(); // reset the left button
      pumpe_value++; 
    }

      if (LCDML_BUTTON_checkEnter()){
      LCDML_BUTTON_resetEnter(); // reset the left button
      LCDML_DISP_funcend();
      } 
  }

    lcd.setCursor(5, 2); // set cursor
    lcd.print(F("   Sekunden"));
    lcd.setCursor(5, 2); // set cursor   
    lcd.print(pumpe_value); // print change content
 }

void LCDML_DISP_loop_end(LCDML_FUNC_pump_zeit_dauer)
{
  if (pumpe_value <= 9){pumpe_value = 10;}
  pumpe_soll_off = pumpe_value*1000;
 
}





// *********************************************************************
unsigned long g_initscreen_example_counter = 0;
void LCDML_DISP_setup(LCDML_FUNC_initscreen)
// *********************************************************************
{
  // setup function
  LCDML_DISP_triggerMenu(1000); // set trigger for this function to 1000 millisecounds
 
  LCDML_BACK_dynamic_setLoopTime(LCDML_BACKEND_sensor, 1000);
 
 
}

void LCDML_DISP_loop(LCDML_FUNC_initscreen)
{
  // loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
  // the quit button works in every DISP function without any checks; it starts the loop_end function
  lcd.setCursor(0,0);
  lcd.write(6);
  lcd.setCursor(3,0);
  lcd.print(F("Min:"));
  lcd.print(solltemperaturmin);
  lcd.setCursor(10,0);
  lcd.print(F("Max:"));
  lcd.print(solltemperaturmax);
  lcd.setCursor(18,0); // clear the secound line on lcd
  lcd.print(F("  "));
  lcd.setCursor(18,0);
  lcd.print(temperatur0);
  lcd.setCursor(0,3);
  lcd.print(F("Anzahl Starts:"));
  lcd.print(starts);
 
  if (freigabe_benutzer == 1){
   lcd.setCursor(0,0);
   lcd.write(5); 
  }


  switch (stat) {
    case 1:
      lcd.setCursor(0,1);
      lcd.print(F("                   "));
      lcd.setCursor(0,2);
      lcd.print(F("Bereit"));
      break;
    case 2:
      snprintf(timebuffer_h,sizeof(timebuffer_h),"%02d:%02d",heizung_minuten,heizung_sekunden);
      lcd.setCursor(0,1);
      lcd.print(F("Heizt noch: "));
      lcd.print(timebuffer_h);
      lcd.setCursor(0,2);
      lcd.print(F("Heizen  "));
      break;
    case 3:
      snprintf(timebuffer_c,sizeof(timebuffer_c),"%02d:%02d",cooldown_minuten,cooldown_sekunden);
      lcd.setCursor(0,1);
      lcd.print(F("Kuhlt noch: "));
      lcd.print(timebuffer_c);
      lcd.setCursor(0,2);
      lcd.print(F("Abkuhlen"));
      break;
    default:
      // if nothing else matches, do the default
      // default is optional
    break;
  }
 




 
  g_lcdml_initscreen = millis(); // reset initscreen timer
 
  if(LCDML_BUTTON_checkAny()) { // check if any button is pressed to left this function
    LCDML_DISP_funcend(); // function end   
  }   
}

void LCDML_DISP_loop_end(LCDML_FUNC_initscreen)

  // this functions is ever called when a DISP function is quit
  // you can here reset some global vars or do nothing
  LCDML_BACK_dynamic_setDefaultTime(LCDML_BACKEND_sensor);
  LCDML.goRoot(); // go to root element (first element of this menu with id=0)
}

 

Mfg Marcus

Ps. das liest sich doch jetzt nicht wirklich jemand komplett durch oder ?

skorpi080

Quote
Ps. das liest sich doch jetzt nicht wirklich jemand komplett durch oder ?
Der war gut :D
Das denk ich mir aber auch jedes mal.
Das passt gut dazu, kann sich jeder darin selbst finden:
http://atomaffe.de/blog/index.php/2015/02/die-typologie-der-forenbenutzer-eine-dokumentation-des-grauens/

Man kann hier zip Files hochladen, dazu musste aber unten auf den Reply Knopf drücken, nicht über Quick Reply.
playground.arduino.cc/PmWiki/433Mhz-Funkmodule

HotSystems

Ps. das liest sich doch jetzt nicht wirklich jemand komplett durch oder ?
Ich meine schon, zumindest sehen ob man offensichtliche Fehler erkennt.
Gruß Dieter

I2C = weniger ist mehr: weniger Kabel, mehr Probleme. 8)

Mars018

Der war gut :D
Das denk ich mir aber auch jedes mal.
Das passt gut dazu, kann sich jeder darin selbst finden:
http://atomaffe.de/blog/index.php/2015/02/die-typologie-der-forenbenutzer-eine-dokumentation-des-grauens/

Man kann hier zip Files hochladen, dazu musste aber unten auf den Reply Knopf drücken, nicht über Quick Reply.
Sehr schöner Blog nur leider kann ich mich darin nicht wirklich finden... oder habe ich den Newbie überlesen ?

Im Anhang ist dann mal der Sketch :)

Mfg Marcus

HotSystems

Spannungsproblem habe ich auch schon überlegt aber mir fällt keine Lösung dafür ein sowas zu triggern.
Ich habe den Sketch nur grob überflogen und nichts gefunden. Was nichts heißen muss.

Um die Spannung zu prüfen, könntest du die Spannung mit dem Controller am analogen Eingang messen und auf den seriellen Monitor schreiben.
Ist der externe Regler heiß geworden. Nimm besser einen StepDown (getaktet).
Wie hast du den Aufbau ausgeführt ?
Steckbrett oder Lochraster ? Steckbrett neigt gern zu Kontaktfehlern.
Gruß Dieter

I2C = weniger ist mehr: weniger Kabel, mehr Probleme. 8)

Go Up