Add support for M300: Play beep sound

This commit is contained in:
Colin Edwards 2013-03-24 23:35:05 -05:00
parent 590225be25
commit 1a0f889803

View File

@ -117,6 +117,7 @@
// M220 S<factor in percent>- set speed factor override percentage // M220 S<factor in percent>- set speed factor override percentage
// M221 S<factor in percent>- set extrude factor override percentage // M221 S<factor in percent>- set extrude factor override percentage
// M240 - Trigger a camera to take a photograph // M240 - Trigger a camera to take a photograph
// M300 - Play beepsound S<frequency Hz> P<duration ms>
// M301 - Set PID parameters P I and D // M301 - Set PID parameters P I and D
// M302 - Allow cold extrudes // M302 - Allow cold extrudes
// M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C) // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
@ -1424,6 +1425,20 @@ void process_commands()
} }
break; break;
#ifdef BEEPER
case 300: // M300
{
int beepS = 1;
int beepP = 1000;
if(code_seen('S')) beepS = code_value();
if(code_seen('P')) beepP = code_value();
tone(BEEPER, beepS);
delay(beepP);
noTone(BEEPER);
}
break;
#endif // M300
#ifdef PIDTEMP #ifdef PIDTEMP
case 301: // M301 case 301: // M301
{ {