stepper = this;
this->register_for_event(ON_BLOCK_BEGIN);
this->register_for_event(ON_BLOCK_END);
+ this->register_for_event(ON_GCODE_EXECUTE);
this->register_for_event(ON_PLAY);
this->register_for_event(ON_PAUSE);
this->paused = false;
}
+void Stepper::on_gcode_execute(void* argument){
+ Gcode* gcode = static_cast<Gcode*>(argument);
+
+ if( gcode->has_letter('M')){
+ int code = (int) gcode->get_value('M');
+ if( code == 84 ){
+ this->alpha_en_pin->set(0);
+ this->beta_en_pin->set(0);
+ this->gamma_en_pin->set(0);
+ }
+ }
+}
+
// A new block is popped from the queue
void Stepper::on_block_begin(void* argument){
Block* block = static_cast<Block*>(argument);