An update on out temperature sensor development! We had to fix the spool to be able to spin and release the temperature one wire sensor. However, the adjustment was not huge. All we did was change the positioning of the motor and spool so that the wire would roll off. Furthermore the realization we had was that our spool was not spinning and releasing the wire because unlike other spools, the wire was attached ton something outside of the spool. Therefore to fix this we are going to hot glue part of temperature sensor and see if that will help. Furthermore we 3-D printed part of our spool and got the rod to fit after so many failed attempts. Update with the code! The temperature sensor code is nearly complete. It took some trial and error to finally be able to get a working code that prints in both Celsius and Fahrenheit. They code below works by doing the following. First, it sets up a new sensor object. For those who dont know, an object is kind of like making a digital version of what it is your making in real life. It creates an instance of something and takes properties of the class it is part of. This class was included as part of the library we have. For example if the external library included a “dog” class, we could make a new dog object called myDog and it would have all the characteristics listed in the dog class such as fur color and happiness etc. Continuing on after we setup and made the temperature sensor object, i used many different commands that were included in the external library. What it basically ode sin the loop is constantly request for temperatures from the sensor. The sensor will then give the computer the temperatures it is picking up in Celsius. So i make float variable Celsius set to whatever the computer receives from the temperature sensor because it is already in Celsius. To get the system to print in Fahrenheit, I set the Fahrenheit float equal to the conversion equation of whatever Celsius is. I then have each of them repseictively print out the temperature in Fahrenheit and Celsius. Next up we have to program the LED’s!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
May 2018
Categories |
Photo used under Creative Commons from daryl_mitchell