public async Task ExecuteAsync() { var senseHat = _senseHatFactory.Create(); var foregroundPink = new RgbColor(255, 0, 255); var config = _ledPixelConfigFactory.CreateForNumber( 1, foregroundPink, RgbColor.CreateBlack()); await senseHat.LedMatrix.ShowPixels(config); }
public static void Main() { var containerConfig = ContainerConfiguration.CreateFromAssembly(typeof(Program).Assembly); var serviceLocator = ContainerInitializationService .CreateInitializedContainer(containerConfig) .GetInstance <IServiceLocator>(); var senseHatFactory = serviceLocator.GetService <ISenseHatFactory>(); var senseHat = senseHatFactory.Create(); var yellow = new RgbColor(255, 231, 14); var black = RgbColor.CreateBlack(); while (true) { ReadAndShowTemperature(senseHat, yellow, black); Thread.Sleep(10000); } }