Servo that moves based on temperature readings from a thermistor

Dependencies:   mbed

Revision:
1:563cf31920da
Parent:
0:e043caac158b
Child:
2:319ee9815aba
--- a/main.cpp	Wed Nov 13 16:17:15 2019 +0000
+++ b/main.cpp	Wed Nov 13 16:18:07 2019 +0000
@@ -11,7 +11,7 @@
     for(;;){ //for-loop that will allow the program to run through multiple iterations
         float tempurature;
         float y;//float value that stores the duty-cyle calculated on line 15
-        tempurature=readtempurature(&temp);
+        tempurature=readtempurature(&temp); //calls the temperature function and stores its return value
         y = (((0.3*tempurature) + 3)/100); //formula that converts the temperature measured by the thermistor into an equivalent duty-cycle, in order for the servo to display an accurate 1:1 scale, change the constant from 0.3 to 0.05
         servo.period(0.02);  // sets the period of the servo PWM to 20 ms as specifed in lesson 7
         servo.write(y); //writes the calculated duty-cycle to the servo