Added z-probe type selection. See M558.

This commit is contained in:
Adrian Bowyer 2013-11-19 15:00:23 +00:00
parent 713a9fb6b1
commit 926aabe078
4 changed files with 18 additions and 4 deletions

View file

@ -1260,6 +1260,11 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
}
break;
case 558: // Set Z probe type
if(gb->Seen('P'))
platform->SetZProbeType(gb->GetIValue());
break;
case 906: // Set Motor currents
for(uint8_t i = 0; i < DRIVES; i++)
{

View file

@ -98,7 +98,7 @@ void Platform::Init()
potWipes = POT_WIPES;
senseResistor = SENSE_RESISTOR;
maxStepperDigipotVoltage = MAX_STEPPER_DIGIPOT_VOLTAGE;
zProbePin = Z_PROBE_PIN;
zProbePin = -1; // Default is to use the switch
zProbeCount = 0;
zProbeSum = 0;
zProbeValue = 0;

View file

@ -89,7 +89,7 @@ Licence: GPL
#define MAX_STEPPER_DIGIPOT_VOLTAGE ( 3.3*2.5/(2.7+2.5) ) // Stepper motor current reference voltage
#define Z_PROBE_AD_VALUE 400
#define Z_PROBE_STOP_HEIGHT 0.7 // mm
#define Z_PROBE_PIN -1 // Analogue pin number
#define Z_PROBE_PIN 0 // Analogue pin number
#define MAX_FEEDRATES {50.0, 50.0, 3.0, 16.0} // mm/sec
#define ACCELERATIONS {800.0, 800.0, 10.0, 250.0} // mm/sec^2
#define DRIVE_STEPS_PER_UNIT {91.4286, 91.4286, 4000.0, 910.0}
@ -464,6 +464,7 @@ class Platform
void SetZProbeStopHeight(float z);
long ZProbe();
void SetZProbe(int iZ);
void SetZProbeType(int iZ);
// Heat and temperature
@ -799,6 +800,14 @@ inline void Platform::SetZProbe(int iZ)
zProbeADValue = iZ;
}
inline void Platform::SetZProbeType(int pt)
{
if(pt != 0)
zProbePin = Z_PROBE_PIN;
else
zProbePin = -1;
}
//********************************************************************************************************

View file

@ -725,7 +725,7 @@ function viewModel()
};
/*
if (window.File && window.FileReader && window.FileList && window.Blob)
{
setTimeout(function() {
@ -736,7 +736,7 @@ function viewModel()
{
alert('The File APIs are not fully supported by your browser. GCode upload may not work.');
}
*/
onControlPage = false;
self.getName();
//self.getPoll();