Skip to content

Commit 4f5b366

Browse files
committed
Add MakerBot flavored GCode.
1 parent c338f4a commit 4f5b366

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

gcodeExport.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,20 @@ class GCodeExport
266266
{
267267
if (currentFanSpeed == speed)
268268
return;
269-
if (speed > 0)
270-
fprintf(f, "M106 S%d\n", speed * 255 / 100);
271-
else
272-
fprintf(f, "M107\n");
269+
if (speed > 0)
270+
{
271+
if (flavor == GCODE_FLAVOR_MAKERBOT)
272+
fprintf(f, "M126 T0 ; value = %d\n", speed * 255 / 100);
273+
else
274+
fprintf(f, "M106 S%d\n", speed * 255 / 100);
275+
}
276+
else
277+
{
278+
if (flavor == GCODE_FLAVOR_MAKERBOT)
279+
fprintf(f, "M127 T0\n");
280+
else
281+
fprintf(f, "M107\n");
282+
}
273283
currentFanSpeed = speed;
274284
}
275285

settings.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ class _ConfigSettingIndex
3737
* M106 Sxxx and M107 are used to turn the fan on/off.
3838
**/
3939
#define GCODE_FLAVOR_ULTIGCODE 1
40+
/**
41+
* Makerbot flavored GCode.
42+
* Looks a lot like RepRap GCode with a few changes. Requires MakerWare to convert to X3G files.
43+
* Heating needs to be done with M104 Sxxx T0
44+
* No G21 or G90
45+
* Fan ON is M126 T0 (No fan strength control?)
46+
* Fan OFF is M127 T0
47+
* Homing is done with G162 X Y F2000
48+
**/
49+
#define GCODE_FLAVOR_MAKERBOT 2
4050

4151
class ConfigSettings
4252
{

0 commit comments

Comments
 (0)