dyadica.net

Fun and Games in the Dyadic Sea

Archive for the ‘C#’ Category

permalink image comments image
Friday, 31 July '09: Adding The Step Event

In this Instruction we are going to modify WiimoteLib by including a new event trigger that is activated upon a change in either Quad or Zone value.

This is a very useful addition that allows for “singular” triggering so that you don’t have to rely on “flag checks” within the standard WiimoteState loop and thus allowing the Libary to do all the work!

Before we start, this instruction assumes you have previously completed the Areas Quad and Zone Instruction.

Start off by opening up the Events.cs file and add the following code below the public class WiimoteChangedEventArgs: Read..

Tags: , , , , , , , ,
permalink image comments image
Thursday, 30 July '09: Merging Quadzone and Quadrant

Here we have another step down the path towards full Balance Board Orientation. This time out we are going to merge the Quadrant and Quadzone functionality into a new collective known as “Area” (for want of a better name).

Please note that this instruction assumes familiarity with the Quadrant and Quadzone instructions.

Similar to the Grouping GOG instruction we are going to start by modifying the DataTypes.cs file  by grouping the two existing definitions by grouping them together in a new struct.

Replace both the Quadrant and Quadzone definitions with the following singular block of code:

/// <summary>
/// Area of most Weight/COG
/// </summary>
[DataMember]
public Area Area;

Next we are going to add the new struct so that we can use this definition. Below the BalanceBoardState struct add the following code: Read..

Tags: , , , , , , , , ,
permalink image comments image
Thursday, 23 July '09: Wii Motion Plus Beta Support

Brian has done it again, check out the following cross-posting from brianpeek.com detailing beta support for the Wii Motion Plus:

I have posted a new version of WiimoteLib as a beta for people to play around with the Wii MotionPlus accessory.  Please note that this is not a stable release and should only be used if you wish to mess around with the MotionPlus.  Also note that only C# source code is included in this release as it is not a final build.  Here’s the change log:

v1.8.0.0

  • Taiko Drum Master’s TaTaCon drum controller supported (Dean Herbert)
  • Bare-bones Wii MotionPlus support (wiibrew.org, testing by Tyler Tolley)
  • WiimoteTest UI changed to add MotionPlus data
    • Please note that the current version is VERY flakey and may not work at all for you.
    • Pair your Wiimote, plug in your MotionPlus, call InitializeMotionPlus()
    • Extensions plugged into the MotionPlus will give wacky results…not supported…yet!
    • Internal changes to perhaps fix some threading issues

So remember, it’s a beta, it may not work for you, and the data you’ll get back from the accessory is just the raw data it provides.  You won’t get real orientation values.

That said, head over to CodePlex and give it a try! (Brian Peek)

Great work Brian!

Tags: , , ,
permalink image comments image
Wednesday, 15 July '09: Dampened and Standard COG

A bit of history: Inspired by endquotes WPF implementation of COG I developed an equivalent system for WiimoteLib that provides  facility for Dampened COG output. As stated, I find the two systems can be used to compliment each other greatly depending upon the desired application requirement. To me the next obvious step was to group both of the outputs together as two available types under the single banner CenterOfGravity.

Using the format of the Wiimote Test application, once complete this instruction will enable access to each COG output as follows:

// Standard COG
lblCOG.Text = ws.BalanceBoardState.CenterOfGravity.Standard.ToString();
// Dampened COG
lblDampenedCOG.Text = ws.BalanceBoardState.CenterOfGravity.Dampened.ToString();

Before you start this instruction assumes use of a raw copy of WiimoteLib 1.7 and have looked at the Adding Dampened COG to WiimoteLib instruction.

Here is how its done: Read..

Tags: , , , , , , ,
permalink image comments image
Tuesday, 14 July '09: The Balance Board Quadzone Filter for WiimoteLib

There are times when using the WiiFit Balance Board with WiimoteLib that I find it useful to have direct access to which particular “Zone” currently has focus (most weight or COG applied), just think WiiFit areobics etc. Output is fed back as a string which can then be used as desired eg in a switch or if statement etc.

Here’s how its done:

First of all open up Data Types.cs and add the following code block within the BalanceBoardState struct:

/// <summary>
/// Current Balance Board Zone
/// </summary>
[DataMember]
public string Quadzone;

Next open up Wiimote.cs and locate the parse extension function. For convenience sake the following block shorthands the values included with WiimoteLib to help with RSI. Add the following code below the existing COG code just above the break: Read..

Tags: , , , , , ,
permalink image comments image
Tuesday, 14 July '09: The Balance Board Quadrant Filter for WiimoteLib

There are times when using the WiiFit Balance Board with WiimoteLib that I find it useful to have direct access to which particular “Quadrant” currently has focus (most weight or COG applied), as with the Quadzone Filter just think WiiFit areobics etc.

When used in conjunction with the Quadzone Filter you have the basic tools needed for very simple forms of navigation. As with the Quadzone filter, output is fed back as a string which can then be used as desired eg in a switch or if statement etc.

So without further ado heres how its done:

First of all open up Data Types.cs and add the following code block within the BalanceBoardState struct:

/// <summary>
/// Current Balance Board Quadrant, SJB
/// </summary>
[DataMember]
public string Quadrant;

Next open up Wiimote.cs and locate the parse extension function. For convenience sake the following block shorthands the values included with WiimoteLib. The code is the same as that used in the Quadzone tutorial so if you have already implemented it there you can skip this step, otherwise add the following code below the existing COG code just above the break: Read..

Tags: , , , , , , ,
permalink image comments image
Tuesday, 14 July '09: Adding Dampened COG to WiimoteLib

Inspired by endquotes WPF implementation of COG I have developed an equivalent system for WiimoteLib that provides the library with facility for Dampened COG output. I find the two systems can be used to compliment each other greatly depending upon the desired application requirement. Before you start this instruction assumes use of a raw copy of WiimoteLib 1.7

Here is how its done:

Open up Data Types.cs and within the public struct BalanceBoardState add the following blocks of code: Read..

Tags: , , , , , , ,
permalink image comments image
Saturday, 11 July '09: Balance Board BMI

Want to be able to calculate your BMI via WiimoteLib so you can use your board ala WiiFit, heres how its done:

Before we start, for a detailed description of BMI please refer to the following Wikipedia article: http://en.wikipedia.org/wiki/Body_mass_index

The formula for calculating BMI is a simple one and can be defined as follows:

BMI = Weight in kilograms / height in meters² – Metric
BMI = (weight in pounds * 703 ) / height in inches² – Imperial

The following function is passed a WiimoteState value ws and returns BMI as a double. The division by 100 is used to convert a cm user_height value into meters and can quite easily be replaced/removed if desired. Read..

Tags: , , , , , , , ,
permalink image comments image
Friday, 10 July '09: Real Balance Board Orientation

Today is a good day. After a exactly one year and two days, I have finally cracked the enigma of Balance Board Orientation, and have a version which robust enough for release.

Needless to say I am overjoyed, check out the video:

During the last year I have developed numerous implementations for the task, most of which worked, however none strong enough to deal with the heterogeneous error known as untrained users, however no more!

I am now working on implementing the system fully within both WiimoteLib and the WiiCi driver. Check back soon for more details.

Tags: , , , , , ,
permalink image comments image
Sunday, 21 June '09: Creating an MSI Uninstall Program Shortcut

As a general rule, Microsoft expect you to uninstall MSI applications from the Add/Remove Programs tool in the Control Panel.

Sometimes however, its nice to add a Start->Programs Menu – ‘Uninstall Shortcut’ to facilitate this action, for user convenience.

The following post details adding such a shortcut to a simple MSI build in Visual Studio 2008.

Browse to the MSI project folder (using Windows Explorer), right click and select New->Shortcut from the context menu. In the Create Shortcut Wizard dialog that pops up type ‘%windir%\system32\msiexec.exe -x {prodCode} ‘ as the location of the shortcut, where prodCode is the Product Code of the MSI package.

create_shortcut_uninstallerproduct_code_uninstaller

This Product Code can be identified from the Project Properties of the MSI Project in Visual Studio. Also, provide a proper name for the shortcut Read..

Tags: , , , ,

poll categories

css | xhtml | dyadica.net © admin 2010 | powered: wordpress | fuel: ps-wii-elite | top | sign-up