while True: | |
temperature = 25 + (explorerhat.analog.one.read() - 0.75) * 100 | |
print("The temperature is {}c".format(temperature)) | |
thermometer.update(temperature) | |
time.sleep(0.1) |
I then ran into problems with having the RPi Model B+ crashing. I had the overclock settings in the Raspberry Pi configuration set to Turbo overclocking, and I think that was causing the RPi to crash when I tried to run Python IDEL and Minecraft simultaneously. I then set the overclocking to medium and the crashing stopped. It did take me a while to figure out that cursor control with Minecraft the Pi Edition was a bit glitchy... you can only gain control of the basic RPi cursor after you hit escape in Minecraft. Then to regain cursor control you have to get the cursor to hover over the Minecraft window and click.
Once I was able to run the python file, see the temperature sensor read-outs in the Python Shell, and finally see the virtual thermometer in the Minecraft scene, I realized that I couldn't get the temperature readings to go up beyond 30 degrees Celsius while griping the TMP36 sensor with my fingers. To see any visible changes in the virtual thermometer height I had to cool the TMP36 down with an ice-pack. Once I got the temp down to 20 C degrees I finally got some visible results.
Minecraft Pi Edition - Virtual thermometer controlled by TMP36
Minecraft Pi Edition - Analog bars controlled by rotary potentiometer
No comments:
Post a Comment