Skip to content
This repository was archived by the owner on Nov 25, 2022. It is now read-only.

Commit d83075e

Browse files
committed
updated examples.
1 parent c9df8d3 commit d83075e

2 files changed

Lines changed: 19 additions & 23 deletions

File tree

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
Make sure to check [Examples.kt](https://github.com/mhashim6/Pi4K/blob/master/src/main/kotlin/mhashim6/pi4k/Examples.kt).
99

1010
```kotlin
11-
fun blink() {
11+
fun blink() = digitalOutput(GPIO_01) {
1212
while (true) {
13-
digitalOutput(GPIO_01) {
14-
toggle()
15-
delay(500)
16-
}
13+
toggle()
14+
delay(500)
1715
}
1816
}
1917
```
@@ -64,33 +62,33 @@ Add it in your root build.gradle at the end of repositories:
6462

6563
```groovy
6664
allprojects {
67-
repositories {
68-
...
69-
maven { url 'https://jitpack.io' }
70-
}
65+
repositories {
66+
...
67+
maven { url 'https://jitpack.io' }
68+
}
7169
}
7270
```
7371
Add the dependency:
7472
```groovy
7573
dependencies {
76-
implementation 'com.github.mhashim6:Pi4K:0.1'
74+
implementation 'com.github.mhashim6:Pi4K:0.1'
7775
}
7876
```
7977
---
8078
- Maven
8179
```xml
8280
<repositories>
83-
<repository>
84-
<id>jitpack.io</id>
85-
<url>https://jitpack.io</url>
86-
</repository>
81+
<repository>
82+
<id>jitpack.io</id>
83+
<url>https://jitpack.io</url>
84+
</repository>
8785
</repositories>
8886
```
8987
Add the dependency:
9088
```xml
9189
<dependency>
92-
<groupId>com.github.mhashim6</groupId>
93-
<artifactId>Pi4K</artifactId>
94-
<version>0.1</version>
90+
<groupId>com.github.mhashim6</groupId>
91+
<artifactId>Pi4K</artifactId>
92+
<version>0.1</version>
9593
</dependency>
9694
```

src/main/kotlin/mhashim6/pi4k/Examples.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ import com.pi4j.wiringpi.Gpio.delay
1010
*/
1111

1212

13-
fun blink() {
14-
digitalOutput(GPIO_01) {
15-
while (true) {
16-
toggle()
17-
delay(500)
18-
}
13+
fun blink() = digitalOutput(GPIO_01) {
14+
while (true) {
15+
toggle()
16+
delay(500)
1917
}
2018
}
2119

0 commit comments

Comments
 (0)