Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement M405/M406 to enable/disable the filament sensor #1447

Merged
merged 3 commits into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3941,7 +3941,6 @@ extern uint8_t st_backlash_y;
//!@n M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
//!@n M405 - Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder
//!@n M406 - Turn off Filament Sensor extrusion control
//!@n M407 - Displays measured filament diameter
//!@n M500 - stores parameters in EEPROM
//!@n M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
//!@n M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
Expand Down Expand Up @@ -7447,6 +7446,37 @@ SERIAL_PROTOCOLPGM("\n\n");
}
break;

#ifdef FILAMENT_SENSOR
3d-gussner marked this conversation as resolved.
Show resolved Hide resolved
/*!
### M405 - Filament Sensor on <a href="https://reprap.org/wiki/G-code#M405:_Filament_Sensor_on">M405: Filament Sensor on</a>
Turn on Filament Sensor extrusion control.
#### Usage

M405

*/

case 405: // M405 Enable Filament Sensor
{
fsensor.setEnabled(1);
}
break;
/*!
### M406 - Filament Sensor off <a href="https://reprap.org/wiki/G-code#M406:_Filament_Sensor_off">M406: Filament Sensor off</a>
Turn off Filament Sensor extrusion control.
#### Usage

M406

*/

case 406: // M406 Disable Filament Sensor
{
fsensor.setEnabled(0);
}
break;
#endif
Commod0re marked this conversation as resolved.
Show resolved Hide resolved

/*!
### M500 - Store settings in EEPROM <a href="https://reprap.org/wiki/G-code#M500:_Store_parameters_in_non-volatile_storage">M500: Store parameters in non-volatile storage</a>
Save current parameters to EEPROM.
Expand Down