Skip to content

Instantly share code, notes, and snippets.

@Grabacr07
Created November 10, 2014 17:10
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 Grabacr07/7a5a18fd7ad091feb8bc to your computer and use it in GitHub Desktop.
Save Grabacr07/7a5a18fd7ad091feb8bc to your computer and use it in GitHub Desktop.
Blync を光らせて遊ぶ (コンソールから (テスト))
class Program
{
static void Main(string[] args)
{
var controller = new BlyncLightController();
var numberOfDevices = controller.InitBlyncDevices();
if (numberOfDevices == 0) return;
try
{
var color = 0;
while (true)
{
var input = Console.ReadLine();
if (input == "exit") break;
if (input == "blink-fast")
{
controller.Blink((BlyncLightController.Color)color, BlyncLightController.Speed.Fast, 0);
continue;
}
if (input == "blink-slow")
{
controller.Blink((BlyncLightController.Color)color, BlyncLightController.Speed.Slow, 0);
continue;
}
if (int.TryParse(input, out color))
{
controller.Display((BlyncLightController.Color)color, 0);
}
}
}
finally
{
controller.CloseDevices(numberOfDevices);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment