Skip to content

Commit 3cfb260

Browse files
committed
Update PID examples to use ObservableAnalogInput for consistency
1 parent 18f152b commit 3cfb260

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/PIDMotorSpeedControl/PIDMotorSpeedControl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using namespace Reactive;
1414
// Hardware: Encoder on pins 2&3, motor driver on pin 9, potentiometer on A0
1515

1616
auto encoder = ObservableRotaryEncoder<RotaryEncoderData>(2, 3);
17-
auto potentiometer = AnalogInput(A0, 100); // Read setpoint every 100ms
17+
auto potentiometer = ObservableAnalogInput(A0, 100); // Read setpoint every 100ms
1818
auto speedTimer = IntervalMillis(250); // Calculate speed every 250ms
1919

2020
auto pidController = FilterPID<float>(0, 1.5, 0.2, 0.1, -255, 255);

examples/PIDTemperatureControl/PIDTemperatureControl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using namespace Reactive;
1313
// PID Temperature Controller Example
1414
// Hardware: Temperature sensor on A0, heater control on pin 9
1515

16-
auto tempSensor = AnalogInput(A0, 200); // Read temperature every 200ms
16+
auto tempSensor = ObservableAnalogInput(A0, 200); // Read temperature every 200ms
1717
auto pidController = FilterPID<float>(25.0, 2.0, 0.1, 0.5, 0, 255); // Setpoint 25°C, Kp=2.0, Ki=0.1, Kd=0.5
1818

1919
const int HEATER_PIN = 9;

0 commit comments

Comments
 (0)