I was really lucky lately to get my hands on a netduino. I’ve never programmed on such a small device before and I have to confess that it’s really fun and awesome!
First, take a look at the video to see what’s going on. Basically, we are instructing the netduino to play a specific set of noted via a web browser on our PC.
(Please visit the site to view this video)
We’re using a netduino device. For the unaware, it’s a small device that runs a small version of the “big” .NET Framework, called .NET Micro Framework, so one can easily use C# and Visual Studio to code for it. It’s connected to a Piezo, a small component that can create some noise.
We’ve connected the netduino to our PC via USB cable and via an Ethernet cable. The USB connection allows us to deploy and debug our stuff on the device whereas the Ethernet cable allows us to make a small LAN between netduino and our PC. Without any more hassle, let’s check the code!
Code was found on Getting Started with Netduino book. It basically adds octaves on a hashtable, sets frequency and period, connects to the speaker (via PWM which is accepting input on the Digital 5 Pin) and plays the respective input. Check the full code here
The code to detect if the request contains a note to play is pretty simple
All in all, that was rather easy and fun! Stay tuned for more .NET Micro Framework posts! As always, the code can be found on GitHub https://github.com/dgkanatsios/NetduinoPlayMusicRemotely
PS. Many thanks to Laurent for his help to get started, don’t miss his excellent .NET Micro Framework blog here!