Raspberry Pi Roundup - a terrarium, Zero audio output and a SenseHAT-driven Battleships game
Terrarium
Amsterdam-based Dendroboard forum user Corbosman has finally gotten around to having a Terrarium built and he controls the whole thing with a Raspberry Pi. His environment measures 120x60x110cm (48x24x42″) and it focuses on the growing and cultivation of orchids; eventually, it will house Panamanian dart frogs.
To control the environment, Corbosman and his brother (an electrician) have set-up two systems: one controlled by the Pi and one controlled by a series of timers. The idea being that when he needs to do something with the Pi, like change the Node-RED programming, he just switches it over to the timers.
All in all, a highly impressive system. You can read more technical details about the system and see more photographs here.
Audio Basics
The guys over at Tinkernut have posted a great tutorial video that shows you how to give a Zero a 3.5mm audio jack by hooking up some prototyping board to the GPIO and adding some common components. Take a look below:
Battleships
Dan Aldred has posted the code for a SenseHAT-based version of the classic game Battleships. Here’s how he describes it:
The program creates a random layout of boats, ammo and water. Use the joystick to select a location and then press Enter to fire a Torpedo.
If you miss you will here a splash of water, if you hit then you will hear the explosion. Else you may find an ammo dump. Each square is then coloured, blue for water, red for a ship and yellow for ammo. You will be updated n the number of ships left to destroy.
When you have used all your Torpedoes up or you have destroyed all the ships, then game ends and you are updated with your score. You can select to play again and a new random layout is created, or leave the game.
Great idea from Dan! You can download the Python 3 code here and see a video of it in action below: