Skip to content

Instantly share code, notes, and snippets.

@hatsunea
Last active August 12, 2022 21:21
Show Gist options
  • Save hatsunea/8720446295f87a79568c2f2feb555f0f to your computer and use it in GitHub Desktop.
Save hatsunea/8720446295f87a79568c2f2feb555f0f to your computer and use it in GitHub Desktop.
using System;
using System.Threading;
using nanoFramework.M5Stack;
using Console = nanoFramework.M5Stack.Console;
namespace M5StickCHelloSample
{
public class Program
{
public static void Main()
{
Setup();
Console.WriteLine("HelloWorld");
Loop();
}
private static void Setup()
{
M5StickCPlus.InitializeScreen();
M5StickCPlus.ButtonM5.Press += (s, e) =>
{
Console.WriteLine("M5 Pressed");
};
M5StickCPlus.ButtonRight.Press += (s, e) =>
{
Console.WriteLine("Right Pressed");
};
Console.Clear();
Console.ForegroundColor = nanoFramework.Presentation.Media.Color.White;
}
private static void Loop()
{
while (true)
{
Thread.Sleep(1000);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment