Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public sealed partial class MainPage : Page
  2. {
  3.  
  4. private GpioPin pin;
  5.  
  6.  
  7. public MainPage()
  8. {
  9. this.InitializeComponent();
  10.  
  11. InitGPIO();
  12. Temperatur();
  13. }
  14.  
  15. public void InitGPIO()
  16. {
  17. var gpio = GpioController.GetDefault();
  18. pin = gpio.OpenPin(4,GpioSharingMode.Exclusive);
  19. Dht11 dht11 = new Dht11(pin, GpioPinDriveMode.Input);
  20. }
  21. private async void Temperatur()
  22. {
  23. while(true)
  24. {
  25. DhtReading reading = await dht11.GetReadingAsync().AsTask();
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement