grovepi/Software/CSharp/GrovePi/Sensors/SoundSensor.cs
2025-03-21 16:04:17 +01:00

26 lines
510 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GrovePi.Sensors
{
public interface ISoundSensor
{
int SensorValue();
}
internal class SoundSensor : Sensor<ISoundSensor>, ISoundSensor
{
public SoundSensor(IGrovePi device, Pin pin) : base(device, pin, PinMode.Input)
{
}
public int SensorValue()
{
return Device.AnalogRead(Pin);
}
}
}