Browse Source

Merge pull request #434 from DDRBoxman/Marlin_v1

Add support for M300: Play beep sound
ErikZalm 11 years ago
parent
commit
86867928ac
2 changed files with 26 additions and 1 deletions
  1. 15
    0
      Marlin/Marlin_main.cpp
  2. 11
    1
      Marlin/pins.h

+ 15
- 0
Marlin/Marlin_main.cpp View File

117
 // M220 S<factor in percent>- set speed factor override percentage
117
 // M220 S<factor in percent>- set speed factor override percentage
118
 // M221 S<factor in percent>- set extrude factor override percentage
118
 // M221 S<factor in percent>- set extrude factor override percentage
119
 // M240 - Trigger a camera to take a photograph
119
 // M240 - Trigger a camera to take a photograph
120
+// M300 - Play beepsound S<frequency Hz> P<duration ms>
120
 // M301 - Set PID parameters P I and D
121
 // M301 - Set PID parameters P I and D
121
 // M302 - Allow cold extrudes
122
 // M302 - Allow cold extrudes
122
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
123
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
1431
       }
1432
       }
1432
     }
1433
     }
1433
     break;
1434
     break;
1435
+    
1436
+    #if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1
1437
+    case 300: // M300
1438
+    {
1439
+      int beepS = 1;
1440
+      int beepP = 1000;
1441
+      if(code_seen('S')) beepS = code_value();
1442
+      if(code_seen('P')) beepP = code_value();
1443
+      tone(BEEPER, beepS);
1444
+      delay(beepP);
1445
+      noTone(BEEPER);
1446
+    }
1447
+    break;
1448
+    #endif // M300
1434
 
1449
 
1435
     #ifdef PIDTEMP
1450
     #ifdef PIDTEMP
1436
     case 301: // M301
1451
     case 301: // M301

+ 11
- 1
Marlin/pins.h View File

321
 
321
 
322
 #if MOTHERBOARD == 33 || MOTHERBOARD == 34
322
 #if MOTHERBOARD == 33 || MOTHERBOARD == 34
323
 
323
 
324
+#define LARGE_FLASH        true
325
+
324
 #define X_STEP_PIN         54
326
 #define X_STEP_PIN         54
325
 #define X_DIR_PIN          55
327
 #define X_DIR_PIN          55
326
 #define X_ENABLE_PIN       38
328
 #define X_ENABLE_PIN       38
789
  #endif
791
  #endif
790
 #endif
792
 #endif
791
 
793
 
794
+#define LARGE_FLASH true
795
+
792
 #define X_STEP_PIN 25
796
 #define X_STEP_PIN 25
793
 #define X_DIR_PIN 23
797
 #define X_DIR_PIN 23
794
 #define X_MIN_PIN 22
798
 #define X_MIN_PIN 22
924
  #endif
928
  #endif
925
 #endif
929
 #endif
926
 
930
 
931
+#define LARGE_FLASH true
932
+
927
 #define X_STEP_PIN 25
933
 #define X_STEP_PIN 25
928
 #define X_DIR_PIN 23
934
 #define X_DIR_PIN 23
929
 #define X_MIN_PIN 15
935
 #define X_MIN_PIN 15
1080
 #error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
1086
 #error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
1081
 #endif
1087
 #endif
1082
 
1088
 
1089
+#define LARGE_FLASH        true
1090
+
1083
 #define X_STEP_PIN          0
1091
 #define X_STEP_PIN          0
1084
 #define X_DIR_PIN           1
1092
 #define X_DIR_PIN           1
1085
 #define X_ENABLE_PIN       39
1093
 #define X_ENABLE_PIN       39
1413
 #error Oops!  Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
1421
 #error Oops!  Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
1414
 #endif
1422
 #endif
1415
 
1423
 
1424
+#define LARGE_FLASH true
1425
+
1416
 #define X_STEP_PIN 37
1426
 #define X_STEP_PIN 37
1417
 #define X_DIR_PIN 48
1427
 #define X_DIR_PIN 48
1418
 #define X_MIN_PIN 12
1428
 #define X_MIN_PIN 12
1488
  #endif
1498
  #endif
1489
 
1499
 
1490
 
1500
 
1491
-
1501
+#define LARGE_FLASH        true
1492
 
1502
 
1493
 #define X_STEP_PIN         26
1503
 #define X_STEP_PIN         26
1494
 #define X_DIR_PIN          28
1504
 #define X_DIR_PIN          28

Loading…
Cancel
Save