Skip to content

Commit 275662e

Browse files
committed
Updates
1 parent 4067a43 commit 275662e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ $port->write("Hello, RevPi!");
234234
$response = $port->read(128); // up to 128 bytes
235235

236236
// Register event handler for readable data
237-
$port->onReadable(function($data) {
238-
echo "Serial received: $data\n";
237+
$port->onReadable(function (SerialPort $port) {
238+
echo "Serial received: " . $port->read(1024) . "\n";
239239
});
240240

241241
// Flush or break

0 commit comments

Comments
 (0)