From 648f0b0100009c8bc1a6c39cfeab5a5f2ddf84c5 Mon Sep 17 00:00:00 2001 From: Jozef Sovcik Date: Sun, 24 Mar 2019 11:20:03 +0100 Subject: [PATCH] Update README.md --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7c9b216..2995ffe 100644 --- a/README.md +++ b/README.md @@ -71,16 +71,12 @@ thp.writeBuffer(); ``` **Query Printer Status** - -First start automatic status polling - -``` -thp.startStatusUpdate(1000); // check interval in milliseconds +Inside your loop() call printer's status update method and query status. ``` - -Then inside your loop() call printer's loop() method and query status. -``` -thp.loop(); +if (millis()-lastUpdateTime > 5000){ // check status each 5 seconds + thp.updatePrinterStatus(); + lastUpdateTime - millis(); +} if (thp.status() != status){ status = thp.status(); Serial.printf("Printer status changed=%x\n",status);