Esempio n. 1
0
        public static Led GetOrCreateLed(this IFoundationPlate plate, DigitalPort port, Color displayColor)
        {
            var led   = plate.GetOrCreateDevice <Led>(port);
            var p     = displayColor.ToPixel <Argb32>();
            var alpha = p.A / 255.0;

            led.DisplayProperties.Add(new RgbaCssColor(p.R, p.G, p.B, alpha));
            return(led);
        }
Esempio n. 2
0
 public static Led GetOrCreateLed(this IFoundationPlate plate, DigitalPort port)
 {
     return(plate.GetOrCreateDevice <Led>(port));
 }
Esempio n. 3
0
 public static UltrasonicSensor GetOrCreateUltrasonicSensor(this IFoundationPlate plate, DigitalPort port)
 {
     return(plate.GetOrCreateDevice <UltrasonicSensor>(port));
 }
Esempio n. 4
0
 public static Buzzer GetOrCreateBuzzer(this IFoundationPlate plate, DigitalPort port)
 {
     return(plate.GetOrCreateDevice <Buzzer>(port));
 }
Esempio n. 5
0
 public static Potentiometer GetOrCreatePotentiometer(this IFoundationPlate plate, AnaloguePort port)
 {
     return(plate.GetOrCreateDevice <Potentiometer>(port));
 }
Esempio n. 6
0
 public static LightSensor GetOrCreateLightSensor(this IFoundationPlate plate, AnaloguePort port)
 {
     return(plate.GetOrCreateDevice <LightSensor>(port));
 }