-
-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathProgram.cs
More file actions
25 lines (20 loc) · 757 Bytes
/
Program.cs
File metadata and controls
25 lines (20 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Device.Gpio;
using System.Diagnostics;
using System.Threading;
Debug.WriteLine("Hello from nanoFramework!");
// Setup the GPIO pin to 2 as it is the embedded led in the ESP32
// We create a controller and open the pin in output mode
// If your board has another pin, change here. If you are using an external led, change here as well.
GpioPin led = new GpioController().OpenPin(2, PinMode.Output);
while (true)
{
// Turn on the LED
led.Write(PinValue.High);
Thread.Sleep(500);
// Turn off the LED
led.Write(PinValue.Low);
Thread.Sleep(500);
}
Thread.Sleep(Timeout.Infinite);