Tags Tags used on ChrisHammond.com

Tagged Posts

This blog post is no longer being maintained, visit the Christoc.com Tutorial for customizing the module development templates.

With the 2.0 release of my module development project templates last week I’ve had a few inquiries into how to customize the templates. You can download the templates from http://christoctemplate.codeplex.com/

Why Modify the Templates?

First, why might you want to modify the custom templates? The main reason is that these templates are defined using a specific namespace, DotNetNuke.Modules.*, which is fine in most cases, but what if you want to use your own namespace? Well you have to create a project, then search/replace all instances of that namespace, while not removing any DNN references at the same time. Customizing the project templates will allow you to define your own company namespace, email address, website, and even copyright information, in the template so that you do not have to search/replace every time you create a new project.

Over the next couple of days people should be receiving their Netduino Go Piezo Buzzer Modules, at least if they have ordered them from Amazon.

I was lucky enough to get mine very quickly from Amazon and put together a sample project the other night. This is by no means a complex project, and most of it is code from the public domain for projects based on the original Netduino.

Project Overview

So what does the project do? Essentially it plays 3 “tunes” that are predefined in the code. The tunes and most of the code for the project are based on this thread on Netduino.com.

The primary method for interacting with a Piezo Buzzer module is pretty simple, you just need the following three lines.

PiezoBuzzer Pb1 = new PiezoBuzzer(GoSockets.Socket1);

Socket1 would be the location where you have the module plugged in to the Netduino Go. The ### for SetFrequency is a float, 440.00 should be an A where the note C would be 261.63.Duration is an integer in milliseconds, so 1000 would be 1 second. Basically once you set the frequency you tell the program to sleep for 1 second to let the note play out.

The code in the project is a little more complex than that, providing octaves of notes and their frequencies, as well as the ability to pass in an array of notes and tempo to adjust for speed/duration.

Download the code

But enough of that, how about a video of it in action?

Other Netduino Go Projects

Be sure to check out some of my other Netduino projects and blog posts.

So I was doing some reading tonight on my Nerdkit, I had planned to actually do some playing around with it, but decided just to read a bit. I’ve never coded in C, I did C++ in College (not very well) and do most of my development in C# these days (when I’m doing code, mostly for fun). While all similar, there are a few differences, so doing things in C is a learning experience.
So I have been doing some testing on my website and needed to redirect requests to http://chrishammond.com to http://www.chrishammond.com/. Lucky for me the site is using IIRF to manage my urls from the old community server days to my DotNetNuke conversion. Using IIRF I'm able to create a simple rule that will handle the redirects for me, I've pasted in the full blog
A few years back I was enlightened by Chris Paterra in the ways of using NANT scripts to aid in the packaging of DotNetNuke Modules. Using NANT to package your WAP (web application project) modules within Visual Studio 2005 is a snap, and can save you a LOT of time each time you have to come up with a new release. Using NANT scripts we are able to create the Private Assembly Installation ZIP file and Source files for Engage: Publish by running a single command from the Command line. With our Publish module this process takes about 23 seconds on average, for our smaller modules such as Engage: F3 the process takes less than 2-3 seconds. To get started with using NANT scripts in your own development environment you need to download the latest (0.85) release from SourceForge, you can visit the project page at http://sourceforge.net/projects/nant/ Once you've installed NANT on your machine (I install it on my C drive in a c:\nant\ folder) you'll need to add NANT to your system variables path so you can call it from the command line. To do this: Right click on My Computer and choose Properties Go to the Advanced Tab Find the System Variables section and Modify the Path variable Add your NANT folder (c:\nant\) to the path, separating entries with the semicolon (;) Save the settings. Now I'd recommend adding a .BUILD file to your DNN Module's project/solution. I've provided a sample build file on our Tutorial Page at www.engagemodules.com, you do have to login in order to access the file. The provided sample file is a good start for your project, by opening up the file in VS2k5 you'll see it is a XML document with some basic information about the product name and folder location. You'll want to find the references to Engage and EngageF3 in the BUILD file and replace them with the name of your module and business name. You can also play around with the include/exclude options in the Fileset node to add or remove certain types of files from your packages. You'll see the two sections in the build file that define which ZIP files to create, one section is called CreateBinZip and one is called CreateSrcZip. Once you have the BUILD file setup you'll want to check a few more files in your DNN project. In the .DNN File be sure to set your module version properly and include the SQLDATAPROVIDER files, as well as the necessary DLLs. In the AssemblyInfo.vb (.cs in our case. At Engage as we do 95% of our DNN module development in C#) be sure to setup your DLL information and version information. By setting the version number in the assemblyinfo and .dnn file you can get NANT to include the version number in the package's file name, allowing an easy way to handle upgrades from version to version for your modules. Once you have all of the files in the solution setup properly you can run the NANT script. To do that bring up a Command Prompt, change directories to your DNN/desktopmodules/ModuleName/ folder. At the command line type "nant" and watch the magic happen. If everything builds properly the script will create a Package folder in your Module's folder, inside of the Package folder you should find two newly created ZIP files, one labeled Install and one labeled Source.   Technorati Tags: ASP.NET, DotNetNuke, DotNetNuke Tips, Daily Tips, NANT, C#, VB.Net, Module Development, Engage Posted from...

Chris Hammond is a father, husband, leader, developer and car guy. Chris has long specialized in ASP.NET and DotNetNuke development, so you will find a variety of topics here on the website. For more information check out the about me page.

If you are looking for DotNetNuke consulting please visit my business website at http://www.christoc.com/