I had one main goal in mind when I designed the Half-Byte Console: to bring together parent and child in a learning experience. Now that the console is a reality and a few are out in the wild, I want it to do other things. So, I thought ‘what can this do that isn’t expensive and would be easy to add to the Tiny Basic as well?’
Looking around my office, I see a DHT-11 temperature and humidity sensor. Ah ha! These are cheap, just a few dollars each. They are also easy to access in code and, with only three pins, easy to connect. So, this is the Half-Byte Console’s first hack: measuring indoor environment.
The DHT-11 has three pins: +5, data and Ground (-). I chose to use D5 on the console as it is safe to use and won’t interfere with video or the keyboard. Plus, it is easy to get to on the board. I loaded the example sketch and changed the pin reference to make sure it worked. It did.
Next, I added support for the sensor to Tiny Basic. I am working on Version 2 and this support will be part of that release (which should be ready very soon.)
Support comes in the form of two functions:
The parameter for Temp actually has meaning: if the parameter is a zero, the temperature is returned as Celsius. If it is a 1, it is returned as Fahrenheit. Any non-zero parameter defaults to Fahrenheit.
So, now the console can do something useful. I’m anxious to get the release of Tiny Basic out and see what you all can do with this new functionality. I am going to post more on the new features of Tiny Basic (hint…more graphics, LIST is fixed…)
In the mean time, if you have any suggestions for Tiny Basic, please let me know in the comments.