Skip to content

Commit dd5a9b0

Browse files
authored
Merge pull request #12 from alcalyn/patch-1
Fix example code in readme
2 parents 2dceee9 + 00f672c commit dd5a9b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ $board = \Calcinai\PHPi\Factory::create();
4646
Minimal example of reading and setting a pin
4747

4848
```php
49+
use Calcinai\PHPi\Pin\PinFunction;
50+
use Calcinai\PHPi\Pin;
4951

5052
$pin = $board->getPin(17) //BCM pin number
5153
->setFunction(PinFunction::INPUT)
5254
->setPull(Pin::PULL_UP);
5355

5456
//Will be === to Pin::LEVEL_HIGH or Pin::LEVEL_LOW
55-
var_dump($pin->level());
57+
var_dump($pin->getLevel());
5658

57-
$pin->setFunction(PinFunction::OUTPUT)
59+
$pin->setFunction(PinFunction::OUTPUT);
5860
$pin->high();
5961
$pin->low();
6062
```

0 commit comments

Comments
 (0)