Created
July 29, 2020 10:12
-
-
Save jlengrand/f7c581791480e04173388815e1a9a6df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nl.lengrand.cellar; | |
public class TestLib { | |
public static void main(String[] args) throws InterruptedException { | |
Dht11Driver theDriver = new Dht11Driver(); | |
System.out.println("Hello JNI!"); | |
for (int i = 0; i < 5; i++) { | |
float [] res = theDriver.getTemperatureAndHumidity(); | |
if(res[0] != 0 && res[1] != 0){ | |
System.out.println("Receiving " + res[0] + " " + res[1]); | |
} | |
else{ | |
System.out.println("Incorrect data!" + res[0] + " " + res[1]); | |
} | |
Thread.sleep(1000); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment