示例#1
0
        public ActionResult Get(int red, int green, int blue)
        {
            var ledService = new LedService();

            ledService.SetColour(red, green, blue);
            return(Ok());
        }
示例#2
0
        public LEDPage(LedService service)
        {
            InitializeComponent();
            _service       = service;
            BindingContext = _service;

            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    Button           b          = new Button();
                    Tuple <int, int> coordinate = Tuple.Create(i, j);
                    b.Clicked += async(sender, e) =>
                    {
                        await _service.FlipLed(coordinate);
                    };
                    LedGrid.Children.Add(b, j, i);
                }
            }
        }
示例#3
0
 public DeviceController(GpioService gpioService, LedService ledService)
 {
     this.gpioService = gpioService;
     this.ledService  = ledService;
 }
 public LedController(LedService ledService)
 {
     this.ledService = ledService;
 }