Debug motor count
This commit is contained in:
parent
0506510955
commit
9ed6f0719d
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue