Skip to content

Instantly share code, notes, and snippets.

@hatsunea
Last active August 12, 2022 21: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/5a16b578f8c1428a65b10ca337a21b68 to your computer and use it in GitHub Desktop.
Save hatsunea/5a16b578f8c1428a65b10ca337a21b68 to your computer and use it in GitHub Desktop.
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