Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public sealed partial class MainPage : Page
- {
- private GpioPin pin;
- public MainPage()
- {
- this.InitializeComponent();
- InitGPIO();
- Temperatur();
- }
- public void InitGPIO()
- {
- var gpio = GpioController.GetDefault();
- pin = gpio.OpenPin(4,GpioSharingMode.Exclusive);
- Dht11 dht11 = new Dht11(pin, GpioPinDriveMode.Input);
- }
- private async void Temperatur()
- {
- while(true)
- {
- DhtReading reading = await dht11.GetReadingAsync().AsTask();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement