Debug motor count

This commit is contained in:
xdrm-brackets 2017-10-14 09:16:21 +02:00
parent 0506510955
commit 9ed6f0719d
1 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,7 @@
if( !motheure_read() ) // if not active -> continue watching if( !motheure_read() ) // if not active -> continue watching
return false; return false;
slog('Motor active detected', 'motheure-simple:loop', 'motheure'); slog('Motor start', 'motheure-simple:loop', 'motheure');
/* [3] Wait for machine to stop /* [3] Wait for machine to stop
=========================================================*/ =========================================================*/
@ -87,7 +87,9 @@
/* (2) If stopped -> increment offset */ /* (2) If stopped -> increment offset */
if( !motheure_read() ){ if( !motheure_read() ){
$offset++; $offset++;
slog("Motor offset: $offset/$THRESHOLD", 'motheure-simple:loop', 'motheure');
/* (3) If not stopped */ /* (3) If not stopped */
}else{ }else{
@ -107,6 +109,7 @@
$f_data->fwrite( json_encode([ $f_data->fwrite( json_encode([
floor( $stop_ts - $start_ts ) floor( $stop_ts - $start_ts )
]).PHP_EOL ); ]).PHP_EOL );
slog("Motor stop", 'motheure-simple:loop', 'motheure');
/* (2) Return status */ /* (2) Return status */
return true; return true;