-
Notifications
You must be signed in to change notification settings - Fork 586
/
Led.cs
35 lines (31 loc) · 1.06 KB
/
Led.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Device.Gpio;
using Iot.Device.GrovePiDevice.Models;
namespace Iot.Device.GrovePiDevice.Sensors
{
/// <summary>
/// Led class for simple Led
/// </summary>
public class Led : DigitalOutput
{
/// <summary>
/// Led constructor
/// </summary>
/// <param name="grovePi">The GrovePi class</param>
/// <param name="port">The grove Port, need to be in the list of SupportedPorts</param>
public Led(GrovePi grovePi, GrovePort port)
: base(grovePi, port)
{
}
/// <summary>
/// Returns On if the led is on, Off otherwise.
/// </summary>
/// <returns>Returns On if the led is on, Off otherwise</returns>
public override string ToString() => Value == PinValue.High ? "On" : "Off";
/// <summary>
/// Get the name Led
/// </summary>
public new string SensorName => "Led";
}
}