Skip to content

Instantly share code, notes, and snippets.

@hatsunea
Created July 5, 2022 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatsunea/9bb9e3e6094b1e326fc79df9132f9e69 to your computer and use it in GitHub Desktop.
Save hatsunea/9bb9e3e6094b1e326fc79df9132f9e69 to your computer and use it in GitHub Desktop.
using System;
using System.Device.Gpio;
using System.Threading;
namespace LedSample
{
public class Program
{
public static void Main()
{
var gpio = nanoFramework.M5Stack.M5Core2.GpioController;
var led = gpio.OpenPin(19, PinMode.Output);
nanoFramework.M5Stack.Console.Clear();
while (true)
{
Console.WriteLine("LED ON");
led.Write(PinValue.High);
Thread.Sleep(2000);
Console.WriteLine("LED OFF");
led.Write(PinValue.Low);
Thread.Sleep(2000);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment