Commit 7124a92e authored by Simone's avatar Simone

Added support for see the Power Consumption

Added support for an Hall Effect sensor to retrieve the current and calulate Wh
parent aaf8a30d
...@@ -379,7 +379,7 @@ uint8_t debugLevel = 0; ...@@ -379,7 +379,7 @@ uint8_t debugLevel = 0;
static float delta[3] = { 0, 0, 0 }; static float delta[3] = { 0, 0, 0 };
#endif //SCARA #endif //SCARA
#ifdef FILAMENT_SENSOR #if (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
//Variables for Filament Sensor input //Variables for Filament Sensor input
float filament_width_nominal=DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 float filament_width_nominal=DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404
bool filament_sensor=false; //M405 turns on filament_sensor control, M406 turns it off bool filament_sensor=false; //M405 turns on filament_sensor control, M406 turns it off
...@@ -391,6 +391,11 @@ uint8_t debugLevel = 0; ...@@ -391,6 +391,11 @@ uint8_t debugLevel = 0;
int meas_delay_cm = MEASUREMENT_DELAY_CM; //distance delay setting int meas_delay_cm = MEASUREMENT_DELAY_CM; //distance delay setting
#endif #endif
#if (defined(POWER_CONSUMPTION) && defined(POWER_CONSUMPTION_PIN) && POWER_CONSUMPTION_PIN >= 0)
unsigned int power_consumption_meas = 0;
unsigned long power_consumption_hour = 0.0;
#endif
#ifdef LASERBEAM #ifdef LASERBEAM
int laser_ttl_modulation = 0; int laser_ttl_modulation = 0;
#endif #endif
...@@ -5570,17 +5575,15 @@ void process_commands() ...@@ -5570,17 +5575,15 @@ void process_commands()
break; break;
#endif // NABLE_AUTO_BED_LEVELING #endif // NABLE_AUTO_BED_LEVELING
#ifdef FILAMENT_SENSOR #if (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
{ {
#if (FILWIDTH_PIN > -1) if(code_seen('D')) filament_width_nominal=code_value();
if(code_seen('D')) filament_width_nominal=code_value(); else
else {
{ SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); SERIAL_PROTOCOLLN(filament_width_nominal);
SERIAL_PROTOCOLLN(filament_width_nominal); }
}
#endif
} }
break; break;
case 405: //M405 Turn on filament sensor for control case 405: //M405 Turn on filament sensor for control
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment