This repository was archived by the owner on Nov 25, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/kotlin/mhashim6/pi4k Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88Make 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
6664allprojects {
67- repositories {
68- ...
69- maven { url 'https://jitpack.io' }
70- }
65+ repositories {
66+ ...
67+ maven { url 'https://jitpack.io' }
68+ }
7169}
7270```
7371Add the dependency:
7472``` groovy
7573dependencies {
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```
8987Add 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```
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments