@ -51,6 +49,7 @@ unsigned long last_sensor_read=0;
#define POSITION_SPEEDMEASURE_HIGH 1000.0 //at which position (in mm) speedfactorHigh should be measured (should be at least two encoder segments beyond that left)
#define MAX_ALLOWED_CLASSIFY_LENGTH 20 //[mm] . for error check. after with length traveled without successfull classification error should be triggered
#define PIN_SENSE A0
unsignedlonglast_print=0;
@ -114,8 +113,7 @@ struct blindmodel
floatsoftlimit_min=0;
floatsoftlimit_max=1000;//doubled value for folding bilds
unsignedlonglast_sense_ok=0;//last time sensor measured class ok
//TODO: implement timeout if last_sense_ok gets too high.
unsignedlongposition_last_classified_ok=0;//last position sensor measured class was ok
uint8_tmode=MODE_IDLE;
@ -149,6 +147,7 @@ unsigned long last_motor_send=0;
#define ERRORCODE_POSITIONDIFFTOOHIGH 1 //deviation too high on position correction
#define ERRORCODE_N_NOT_NEXT 2 //skipped one transition. position jumped too far?
#define ERRORCODE_UNDEFINED_POSITION 3
#define ERRORCODE_CLASSIFY_LENGTH 4
#define THRESHOLD_GO_TO_POS 20 //how close blind has to be to have reached position (in mm)