Exercise (FH): Replace Sensor


As a followup to Exercise (FH): Introducing a Sensor Class, let’s say we want to replace W1Sensor with an instance of ConstantSensor (from <constant-sensor.h>).

  1. Make the change: replace every mention of W1Sensor with its ConstantSensor counterpart.

  2. What do you notice? Respectively, which part of the program did you not expect to change?