diff --git a/ADIS_Csharp/ADIS_Csharp.sln b/ADIS_Csharp/ADIS_Csharp.sln index a644936..3af1a4e 100644 --- a/ADIS_Csharp/ADIS_Csharp.sln +++ b/ADIS_Csharp/ADIS_Csharp.sln @@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MqttTest", "MqttTest\MqttTe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RobotLib", "RobotLib\RobotLib.csproj", "{915E2889-F10D-4D02-8313-308F642EC64F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RobotConsoleClient", "RobotConsoleClient\RobotConsoleClient.csproj", "{7FFC4B71-FFC2-45A1-941D-4B0A78C20B89}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -57,6 +59,10 @@ Global {915E2889-F10D-4D02-8313-308F642EC64F}.Debug|Any CPU.Build.0 = Debug|Any CPU {915E2889-F10D-4D02-8313-308F642EC64F}.Release|Any CPU.ActiveCfg = Release|Any CPU {915E2889-F10D-4D02-8313-308F642EC64F}.Release|Any CPU.Build.0 = Release|Any CPU + {7FFC4B71-FFC2-45A1-941D-4B0A78C20B89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FFC4B71-FFC2-45A1-941D-4B0A78C20B89}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FFC4B71-FFC2-45A1-941D-4B0A78C20B89}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FFC4B71-FFC2-45A1-941D-4B0A78C20B89}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ADIS_Csharp/RobotConsoleClient/Program.cs b/ADIS_Csharp/RobotConsoleClient/Program.cs new file mode 100644 index 0000000..b47f7c6 --- /dev/null +++ b/ADIS_Csharp/RobotConsoleClient/Program.cs @@ -0,0 +1,20 @@ +using RobotLib; + +namespace RobotConsoleClient +{ + internal class Program + { + static void Main(string[] args) + { + Robot.Instance.Connect("eee...", 1818); + Robot.Instance.Buzzer.Beep(300, 500); + Robot.Instance.Battery.BatteryChanged += Battery_BatteryChanged; + Console.ReadLine(); + } + + private static void Battery_BatteryChanged(object? sender, BatteryEventArgs e) + { + Console.WriteLine($"Received Battery Changed event. New Battery voltage = {e.Voltage} V"); + } + } +} \ No newline at end of file diff --git a/ADIS_Csharp/RobotConsoleClient/RobotConsoleClient.csproj b/ADIS_Csharp/RobotConsoleClient/RobotConsoleClient.csproj new file mode 100644 index 0000000..c3a6d28 --- /dev/null +++ b/ADIS_Csharp/RobotConsoleClient/RobotConsoleClient.csproj @@ -0,0 +1,14 @@ + + + + Exe + net6.0 + enable + enable + + + + + + +