Merge pull request #434 from DDRBoxman/Marlin_v1

Add support for M300: Play beep sound
master
ErikZalm 12 years ago
commit 86867928ac

@ -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)
@ -1432,6 +1433,20 @@ void process_commands()
} }
break; break;
#if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1
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
{ {

@ -321,6 +321,8 @@
#if MOTHERBOARD == 33 || MOTHERBOARD == 34 #if MOTHERBOARD == 33 || MOTHERBOARD == 34
#define LARGE_FLASH true
#define X_STEP_PIN 54 #define X_STEP_PIN 54
#define X_DIR_PIN 55 #define X_DIR_PIN 55
#define X_ENABLE_PIN 38 #define X_ENABLE_PIN 38
@ -789,6 +791,8 @@
#endif #endif
#endif #endif
#define LARGE_FLASH true
#define X_STEP_PIN 25 #define X_STEP_PIN 25
#define X_DIR_PIN 23 #define X_DIR_PIN 23
#define X_MIN_PIN 22 #define X_MIN_PIN 22
@ -924,6 +928,8 @@
#endif #endif
#endif #endif
#define LARGE_FLASH true
#define X_STEP_PIN 25 #define X_STEP_PIN 25
#define X_DIR_PIN 23 #define X_DIR_PIN 23
#define X_MIN_PIN 15 #define X_MIN_PIN 15
@ -1080,6 +1086,8 @@
#error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu. #error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
#endif #endif
#define LARGE_FLASH true
#define X_STEP_PIN 0 #define X_STEP_PIN 0
#define X_DIR_PIN 1 #define X_DIR_PIN 1
#define X_ENABLE_PIN 39 #define X_ENABLE_PIN 39
@ -1413,6 +1421,8 @@
#error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu. #error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
#endif #endif
#define LARGE_FLASH true
#define X_STEP_PIN 37 #define X_STEP_PIN 37
#define X_DIR_PIN 48 #define X_DIR_PIN 48
#define X_MIN_PIN 12 #define X_MIN_PIN 12
@ -1488,7 +1498,7 @@
#endif #endif
#define LARGE_FLASH true
#define X_STEP_PIN 26 #define X_STEP_PIN 26
#define X_DIR_PIN 28 #define X_DIR_PIN 28

Loading…
Cancel
Save