Skip to main content

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
Declaration
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
Declaration
public bool IsDisposed { get; }

MaxResistance

Gets the maximum resistance value of the potentiometer.

View Source
Declaration
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
Declaration
public Resistance Resistance { get; set; }

Methods

Dispose(bool)

Releases the unmanaged resources used by the Potentiometer and optionally releases the managed resources.

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingTrue 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
Declaration
public void Dispose()

Events

Changed

Raised when a change is detected

View Source
Declaration
public event EventHandler<IChangeResult<Resistance>>? Changed
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.Resistance>>

Implements

  • Meadow.Hardware.IPotentiometer
  • Meadow.Hardware.IRheostat
  • System.IDisposable