Last active
August 12, 2022 21:21
-
-
Save hatsunea/5a16b578f8c1428a65b10ca337a21b68 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 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