Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using System.Threading;
using nanoFramework.M5Stack;
using Console = nanoFramework.M5Stack.Console;
namespace M5StickBuzzer
{
public class Program
{
public static void Main()
{
Setup();
Loop();
}
private static void Setup()
{
M5StickCPlus.InitializeScreen();
M5StickCPlus.ButtonM5.Press += (s, e) =>
{
Console.WriteLine("M5 Pressed");
M5StickCPlus.Buzzer.PlayTone(440, 1000);
};
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