smoothie port to mbed online compiler (smoothieware.org)

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CartesianSolution.cpp Source File

CartesianSolution.cpp

00001 #include "CartesianSolution.h"
00002 #include <math.h>
00003 
00004 CartesianSolution::CartesianSolution(Config* passed_config) : config(passed_config){
00005     this->alpha_steps_per_mm = this->config->value(alpha_steps_per_mm_checksum)->as_number();
00006     this->beta_steps_per_mm  = this->config->value( beta_steps_per_mm_checksum)->as_number();
00007     this->gamma_steps_per_mm = this->config->value(gamma_steps_per_mm_checksum)->as_number();
00008 }
00009 
00010 void CartesianSolution::millimeters_to_steps( double millimeters[], int steps[] ){
00011     steps[ALPHA_STEPPER] = floor( millimeters[X_AXIS] * this->alpha_steps_per_mm +0.5);
00012     steps[BETA_STEPPER ] = floor( millimeters[Y_AXIS] * this->beta_steps_per_mm +0.5);
00013     steps[GAMMA_STEPPER] = floor( millimeters[Z_AXIS] * this->gamma_steps_per_mm +0.5);
00014 }
00015 
00016 void CartesianSolution::steps_to_millimeters( int steps[], double millimeters[] ){}