Bladeren bron

Added temperature status less.

Hopefully fixed viky button handling without braking other boards
Erik van der Zalm 11 jaren geleden
bovenliggende
commit
8a08cca0f2
4 gewijzigde bestanden met toevoegingen van 810 en 751 verwijderingen
  1. 5
    0
      Marlin/Configuration.h
  2. 37
    1
      Marlin/Marlin_main.cpp
  3. 7
    0
      Marlin/pins.h
  4. 761
    750
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 5
- 0
Marlin/Configuration.h Bestand weergeven

@@ -540,6 +540,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
540 540
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
541 541
 //#define FAST_PWM_FAN
542 542
 
543
+// Temperature status leds that display the hotend and bet temperature.
544
+// If alle hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
545
+// Otherwise the RED led is on. There is 1C hysteresis.
546
+//#define TEMP_STAT_LEDS
547
+
543 548
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
544 549
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
545 550
 // is too low, you should also increment SOFT_PWM_SCALE.

+ 37
- 1
Marlin/Marlin_main.cpp Bestand weergeven

@@ -2938,6 +2938,39 @@ void controllerFan()
2938 2938
 }
2939 2939
 #endif
2940 2940
 
2941
+#ifdef TEMP_STAT_LEDS
2942
+static bool blue_led = false;
2943
+static bool red_led = false;
2944
+static uint32_t stat_update = 0;
2945
+
2946
+void handle_status_leds(void) {
2947
+  float max_temp = 0.0;
2948
+  if(millis() > stat_update) {
2949
+    stat_update += 500; // Update every 0.5s
2950
+    for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
2951
+       max_temp = max(max_temp, degHotend(cur_extruder));
2952
+       max_temp = max(max_temp, degTargetHotend(cur_extruder));
2953
+    }
2954
+    #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
2955
+      max_temp = max(max_temp, degTargetBed());
2956
+      max_temp = max(max_temp, degBed());
2957
+    #endif
2958
+    if((max_temp > 55.0) && (red_led == false)) {
2959
+      digitalWrite(STAT_LED_RED, 1);
2960
+      digitalWrite(STAT_LED_BLUE, 0);
2961
+      red_led = true;
2962
+      blue_led = false;
2963
+    }
2964
+    if((max_temp < 54.0) && (blue_led == false)) {
2965
+      digitalWrite(STAT_LED_RED, 0);
2966
+      digitalWrite(STAT_LED_BLUE, 1);
2967
+      red_led = false;
2968
+      blue_led = true;
2969
+    }
2970
+  }
2971
+}
2972
+#endif
2973
+
2941 2974
 void manage_inactivity()
2942 2975
 {
2943 2976
   if( (millis() - previous_millis_cmd) >  max_inactive_time )
@@ -2991,7 +3024,10 @@ void manage_inactivity()
2991 3024
       memcpy(destination,current_position,sizeof(destination));
2992 3025
       prepare_move(); 
2993 3026
     }
2994
-  #endif  
3027
+  #endif
3028
+  #ifdef TEMP_STAT_LEDS
3029
+      handle_status_leds();
3030
+  #endif
2995 3031
   check_axes_activity();
2996 3032
 }
2997 3033
 

+ 7
- 0
Marlin/pins.h Bestand weergeven

@@ -544,6 +544,13 @@
544 544
     #endif
545 545
   #endif
546 546
 
547
+  #ifdef TEMP_STAT_LEDS
548
+    #if MOTHERBOARD == 67
549
+      #define STAT_LED_RED       6
550
+      #define STAT_LED_BLUE     11
551
+    #endif
552
+  #endif
553
+  
547 554
   #ifdef ULTRA_LCD
548 555
 
549 556
     #ifdef NEWPANEL

+ 761
- 750
Marlin/ultralcd_implementation_hitachi_HD44780.h
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


Laden…
Annuleren
Opslaan