MockSensorIo

open class MockSensorIo : SensorIo

Mocks the IO communication of an actual sensor hardware. Stores a cached value for the pin and simply updates it with the ‘write’ calls. The value is 0 at the beginning.

  • Returns the internally cached value.

    Declaration

    Swift

    public override func read(callback: ((Any) -> ()))
  • Writes on the internally cached value.

    Declaration

    Swift

    public override func write(value: Any)