Servo that moves based on temperature readings from a thermistor

Dependencies:   mbed

Revision:
3:1dd8980f5f07
Parent:
2:319ee9815aba
--- a/main.cpp	Wed Nov 13 17:02:21 2019 +0000
+++ b/main.cpp	Wed Nov 13 17:11:08 2019 +0000
@@ -16,7 +16,7 @@
         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 
-        bite=((28.333333333333*y)-85);
+        bite=((28.333333333333*(y*100))-85);
         printf("The tempurature is: %f\n",tempurature);//prints the temperature in celcius to the serial terminal
         wait(0.5); //waits for half a second before running the next iteration
     }