Last active
August 12, 2022 21:21
-
-
Save hatsunea/8720446295f87a79568c2f2feb555f0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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