Skip to content

Commit 7ad9c70

Browse files
committed
2 parents 4a1586c + d13a6bc commit 7ad9c70

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,22 @@ print file_put_contents('arduino://hello Arduino');
4040

4141
You can use in your project in a OOP style
4242

43+
### Sending data
44+
4345
``` php
4446
$writer = new Arduino\Writer(new Arduino\Wrapper());
4547
$bytes = $writer->out('ttyUSB0', 'from oop');
4648
```
49+
### Reading data
50+
51+
``` php
52+
$arduino = new \Arduino\Wrapper();
53+
54+
$writer = new \Arduino\Reader($arduino);
55+
while (true) {
56+
print $writer->from('/dev/cu.usbmodem1411');
57+
}
58+
```
4759

4860
## Improvements
4961

0 commit comments

Comments
 (0)