BritishIdeas

Interesting Tech Projects

RSS Feeds

  • Home
  • About
  • Contact
  • Open Radio Control

Not All Wii Nunchuks Are Created Equal

Aug 29th

Posted by Andy in Software Engineering

What is the difference between the two Nunchuks below?

Quite a lot actually. The one on the left was bought on ebay for £3.50 and came with no packaging or information. The one on the right was bought from Amazon for £11.20 and came with Nintendo packaging and a warranty. Read on for details of all the differences I discovered. More >

Bookmark to:


Hide Sites
nunchuck, wii

Reading a Wii Nunchuck Using I2C

Aug 20th

Posted by Andy in Software Engineering

There are plenty of descriptions on how to read the joystick, accelerometer and button values from a Wii Nunchuck using I2C but I haven’t seen any waveforms. So here are mine. Click on the images to see them in full size.

The I2C bus was running at about 100kHz. The time between the handshake and the first data read sequence is about 1.8ms and the time between each subsequent data read sequence is also about 1.8ms, although I feel that these times can probably be reduced.

Unlike many code examples I have seen there are no delays between each write operation in the handshake or between the write and read operations of the data read sequence.

First up is the handshake to send “unencrypted” data:

Next is the data read sequence containing a six byte chuck of data with the values we need:

Hopefully these will be useful to people developing application with a Wii Nunchuck.

Bookmark to:


Hide Sites
nunchuck, waveform, wii

Fast Reading of XML Files

Jul 14th

Posted by Andy in Software Engineering

I recently had the need to parse 780MB XML files, and quickly. My preferred language for PC development is C# because I can work quickly and efficiently with it, however I was a bit wary of the speed of XML file processing. Thankfully Mike Taulty has worked out a solution using LINQ and XmlReader, providing the user friendliness of LINQ with the speed of XmlReader.

An initial test showed that a 39MB XML file is processed in 4.9 seconds using Mono on a quad core server running Ubuntu. This is about 8MB/second which means that my 780MB file should be processed in around 98 seconds. Nice!

Bookmark to:


Hide Sites
C#, XML

Convert Any Audio Source Into MP3

Jul 6th

Posted by Andy in Linux

Here is my method that I know works. If you have a better one feel free to post it in the comments section. It may not produce the best quality audio but I’m sure it can be improved.

Obtain a 3.5mm to 3.5mm audio cable, for example this one. Connect one end to the audio source (for example a PC) and the other end to the microphone in on your linux box (I tried line in but that didn’t work for some reason).

Make sure ALSA utilities and ffmpeg are installed (at a console prompt):

$ sudo apt-get install alsa-utils ffpmeg

Start recording with:

$ arecord -f cd -t wav test.wav

Start the audio source and once complete press Ctrl-C to stop recording. Convert to MP3 with:

$ ffmpeg -b 128k -i test.wav test.mp3

I then run the file through MP3Gain as the recordings tend to be a bit quiet and add tags in iTunes.

Bookmark to:


Hide Sites
mp3

Internationalization in Silverlight

May 10th

Posted by Andy in Software Engineering

For some reason Microsoft have made it difficult to work out how to support multiple languages in Silverlight. The solution isn’t hard, once you manage to work it out. It is complicated by the fact that accessing string tables in C# is completely different to accessing them in XAML. Plus there is a nasty bug in Visual Studio which apparently still isn’t fixed.

However, never fear. After trying several approaches, all of which failed in some way, the solution can be found on timheuer.com. Tim presents a clear and straightforward method without needing to do anything weird (except for the Visual Studio bug workaround).

Bookmark to:


Hide Sites
silverlight

Graphing Ping Times

Mar 29th

Posted by Andy in Linux

I recently had the need to generate a graph of ping times between my PC and a British Telecom server. After a quick web search the only options I found were commercial programs or free software that was incredibly bloated, complex to configure and with lots of dependencies. There must be a simpler way, and there is. Perl.

Here is my script:

#!/usr/bin/perl
# Converts ping output into a CSV file for graphing
# andy at british ideas dot com - March 29th 2011
# Public Domain
# Run using:
# ping -D 100.101.102.103 | ./pingtocsv.pl > output.csv
# or:
# cat pingdump.txt | ./pingtocsv.pl > output.csv
print "Measurement Time,Ping Time\n";
while (<STDIN>) {
  if ($_ =~ m/^\[([0-9\.]+)\].*time\=([0-9\.]+).*/i) {
    print "$1,$2\n";
  }
}
close(STDIN);

More >

Bookmark to:


Hide Sites
networks

The Progress of Linux

Mar 4th

Posted by Andy in Linux

2 comments

Back in 1998 I tried installing RedHat 6 on a spare PC. When the desktop loaded it was, ummm, wobbly. I then spent the best part of the next two weeks fighing with X configuration files setting obscure items such as front and back porches in a futile attempt to stabilize the display so it would be usable. I gave up.

Fast forward to March 2011 and Ubuntu 10.10. I’ve used lots of different versions of Ubuntu since 2006 on a variety of machines including for CNC control, but the last time I installed in a dual boot system was two years ago. Ubuntu 10.10 works fine in a virtual machine inside Windows 7 but I wanted to run it at full speed. More >

Bookmark to:


Hide Sites
ubuntu

Why Adobe Has Lost the Plot

Mar 4th

Posted by Andy in Software Engineering

Flash and PDFs are staples of the internet and have been for many years now. I used to develop some flash applications but not anymore as Adobe really has lost their way.

Adobe Reader

Sadly it appears no longer possible to directly download this application and install it. Now you have to get the “Adobe Download Manager” first which then forces you to get a McAfee security program at the same time as Adobe Reader. There are no options to cancel the download or installation of this program and it doesn’t matter that I already have security software on my PC. When will Adobe realize that people want to be able to choose what to download and install? No thanks.

Adobe Flash Player

Back when I bothered to write applications for flash (note – not adverts but client-side file processors and mapping tools) I installed the debug version of Flash Player so I could use FlashBug for debugging. Ever since then Flash Player continually crashes on me when visiting most websites with flash (such as CNN). This is despite uninstalling the debug version and installing the regular version. Sometimes I can dismiss the crash errors and it keeps working and other times it freezes Firefox for several minutes before crashing that too.

On setting up my new Windows 7 installation Flash Player forced me to close Firefox before it would continue – rather than closing and restarting via the add-ons window like all other plugins. After installation FireFox now will only start in “Safe Mode” with many features disabled. Wonderful.

Thanks Adobe for a really great user experience! Or should I say software engineering failure.

Bookmark to:


Hide Sites
adobe, Flash, pdf

50,000 Point GPS Track in Silverlight

Mar 1st

Posted by Andy in Mapping

About six months ago I posted a video showing a GPS track with 7,000 points in a slippy map control called DeepEarth. If you watch the video you can see that the track lags behind the map a little and I think I was at the limit of what was usable.

Yesterday I wrote about my new C# based slippy map control for Silverlight and Moonlight that can display 50,000 map markers and I wanted to see what it’s performance was like for a GPS track. I created a random track with 50,000 points in it to simulate a track from a GPS unit. Here is the result. More >

Bookmark to:


Hide Sites
moonlight, OpenStreetMap, silverlight

50,000 Map Markers in Silverlight

Feb 28th

Posted by Andy in Mapping

2 comments

There are a range of pan and zoom map controls (sometimes called slippy maps) available for C#/.NET and Silverlight/Moonlight. All the ones I’ve seen have something in common – they are bloated. The authors attempt to address the needs of as many users as possible and the result is large downloads and far too many features. The forums and mailing lists are full of people asking how to achieve basic functionality because they are lost in the vast realm of classes.

Of course, it is possible to remove what you don’t need but that requires understanding the code and after all that effort you are left with code that might not have the right license for your needs. The solution? Time to cringe – reinventing the wheel.

Fortunately it’s not much of a wheel, assuming your requirements are simple as mine are. C# and good development tools (Visual Studio and MonoDevelop) makes it easy to quickly develop a lightweight and flexible slippy map that can be used in Windows, Mac OS X and Linux (using Moonlight). More >

Bookmark to:


Hide Sites
moonlight, OpenStreetMap, silverlight
« First...«34567»10...Last »
    • Recent comments
    • Popular posts
    • Archives
    • Tags
    • Categories
    • 3D Printing (21)
    • Banjo (1)
    • CNC (47)
    • Computer Aided Design (13)
    • Electronics (4)
    • Flash (2)
    • Linux (24)
    • Mac OS X (2)
    • Mapping (18)
    • Miscellaneous (8)
    • Photography (13)
    • Software Engineering (29)
    • Windows (5)
    a480 alibre design backlash blender CAD canon chdk diy dvd dxf emc2 endmill fireballcnc flex hardware inkscape JOSM machine maperitive Mapnik mendel MonoMac moonlight nunchuck OpenStreetMap pcb python rendering repetier reprap resources ripping robot scripting silverlight sketchup software speed stepper motors time lapse ubuntu weather wii Windows wizoscript
    • May 2019 (1)
    • December 2017 (2)
    • August 2015 (1)
    • November 2014 (1)
    • October 2014 (1)
    • July 2014 (2)
    • June 2014 (3)
    • September 2013 (5)
    • July 2013 (1)
    • June 2013 (1)
    • April 2013 (4)
    • March 2013 (2)
    • February 2013 (3)
    • November 2012 (1)
    • October 2012 (1)
    • September 2012 (2)
    • August 2012 (1)
    • July 2012 (3)
    • June 2012 (1)
    • March 2012 (1)
    • October 2011 (1)
    • September 2011 (2)
    • August 2011 (2)
    • July 2011 (2)
    • May 2011 (1)
    • March 2011 (4)
    • February 2011 (1)
    • January 2011 (3)
    • September 2010 (1)
    • July 2010 (3)
    • June 2010 (10)
    • April 2010 (1)
    • February 2010 (1)
    • December 2009 (5)
    • September 2009 (2)
    • August 2009 (3)
    • July 2009 (7)
    • June 2009 (1)
    • March 2009 (3)
    • January 2009 (1)
    • October 2008 (1)
    • September 2008 (6)
    • July 2008 (2)
    • June 2008 (5)
    • April 2008 (4)
    • March 2008 (2)
    • February 2008 (2)
    • January 2008 (1)
    • December 2007 (1)
    • November 2007 (7)
    • October 2007 (16)
    • CHDK and Canon A480 Quick Start Guide (54)
    • PCB For Raspberry Pi WH1080 Weather Station (33)
    • Jack the Ripper Bot I – Introduction (29)
    • Jack the Ripper Bot IV – Software (13)
    • Jack the Ripper Bot II – Mechanics (10)
    • Using Inkscape for CNC Designs and DXFs (10)
    • Setting up Raspberry Pi for 3D Printing with RepRap (9)
    • How To Install EMC2 on Unbuntu 7.10 Gutsy From Scratch (9)
    • Importing DXF Files Into Inkscape (8)
    • Jack the Ripper Bot III – Electronics (7)
    • Andy: I can't recall sorry - it's been too long.
    • mr. robo: You write "Attach the Y axis to the core using a M8x220mm threader rod. A M8 nut goes into the nut...
    • Ryan: Thanks for this. I just ordered a dial indicator from Amazon for $15. It seems silly to buy a Drum...
    • Andy: Your toaster oven is probably not suitable for doing this.
    • haimiko: Shouldn't the software be trying to follow the curve? My toaster oven is slow to heat up so the...
    • Dan: Hey Andy, I used your script to get started. Very helpful. Happy New Year!!!
    • Unnerby: Makes sense. Thanks a lot Andy !!
    • Andy: I made the track width and length so it has the matching impedance required.
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds Top