Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2d51e32

Browse files
committed
badges added
1 parent 550ad47 commit 2d51e32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3d57a79cbf3245e0af61e9123fda26eb)](https://www.codacy.com/app/matheus-marabesi/arduino-php-wrapper?utm_source=github.com&utm_medium=referral&utm_content=marabesi/arduino-php-wrapper&utm_campaign=badger)
44
[![Build Status](https://travis-ci.org/marabesi/arduino-php-wrapper.svg?branch=master)](https://travis-ci.org/marabesi/arduino-php-wrapper)
5+
[![Latest Stable Version](https://poser.pugx.org/marabesi/arduino-php-wrapper/v/stable)](https://packagist.org/packages/marabesi/arduino-php-wrapper)
6+
[![Total Downloads](https://poser.pugx.org/marabesi/arduino-php-wrapper/downloads)](https://packagist.org/packages/marabesi/arduino-php-wrapper)
7+
[![composer.lock](https://poser.pugx.org/marabesi/arduino-php-wrapper/composerlock)](https://packagist.org/packages/marabesi/arduino-php-wrapper)
58

69
If you are wondering how to control the Arduino serial port via PHP, here is the solution.
710
The **arduino://** wrapper is a easy and straightforward way to write and read data from Arduino.
@@ -15,7 +18,7 @@ to write date on Arduino serial just use the regular I/O functions in PHP such a
1518

1619
//reads data from Arduino
1720
$resource = fopen('arduino://ttyUSB0', 'r+');
18-
print fread($resource, 1024);
21+
print fread($resource, 1024);
1922
```
2023

2124
Or if you prefer, you can use **file_get_contents** and get the same result
@@ -30,7 +33,7 @@ To write data in the Arduino serial is as easy as it could be
3033

3134
//writes data to Arduino
3235
$resource = fopen('arduino://ttyUSB0', 'r+');
33-
print fwrite('hello Arduino');
36+
print fwrite('hello Arduino');
3437
```
3538

3639
``` php

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /