Class Potentiometer
Represents a potentiometer - a variable resistor that can be measured through an analog input. Implements both IPotentiometer and IDisposable interfaces.
Assembly: Meadow.Foundation.dll
View Source
public class Potentiometer : IPotentiometer, IRheostat, IDisposable
Implements:
Meadow.Hardware.IPotentiometer
, Meadow.Hardware.IRheostat
, System.IDisposable
Properties
IsDisposed
Gets whether this instance has been disposed.
View Source
public bool IsDisposed { get; }
MaxResistance
Gets the maximum resistance value of the potentiometer.
View Source
public Resistance MaxResistance { get; }
Resistance
Gets the current resistance value of the potentiometer by reading the analog input. Setting the resistance throws NotSupportedException as potentiometer value can only be changed mechanically.
View Source
public Resistance Resistance { get; set; }
Methods
Dispose(bool)
Releases the unmanaged resources used by the Potentiometer and optionally releases the managed resources.
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | True to release both managed and unmanaged resources; false to release only unmanaged resources. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
Events
Changed
Raised when a change is detected
View Source
public event EventHandler<IChangeResult<Resistance>>? Changed
Event Type
System.EventHandler<Meadow.IChangeResult<Meadow.Units.Resistance>>
Implements
Meadow.Hardware.IPotentiometer
Meadow.Hardware.IRheostat
System.IDisposable