Arduino Duemilanove Has Arrived!

For my senior design project at Wentworth, we are in need of a micro controller. I ordered the Arduino from SparkFun.com and it arrived yesterday. At the core is the ATMega328 which is plenty powerful for our application (which I’ll introduce in a later post).

The device has so many uses with its various shields and add ons such as ethernet and wifi. If you ever wanted to start getting into electronics, hardware or if you ever wanted to make something you’ve always wanted, the Arduino is a great start.

The ATMega328 contains the Arduino bootloader so we can flash it with the WIRE programming language (it’s pretty much C++, just dumbed down). It comes with plenty of examples so you can tweak existing code or piece together you own application.

Continue reading

Share and Enjoy:
  • Print
  • Digg
  • Twitter
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Mixx
Posted in Hardware, Projects | Tagged , , | 2 Comments

Workstation in May

This is my current workstation, new LCD came about a month ago. I can always use more desktop space!

My awesome Apple keyboard

Share and Enjoy:
  • Print
  • Digg
  • Twitter
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Mixx
Posted in Life | Tagged , | 1 Comment

A State of Trance: 450 NYC – Day 2 and other videos…

I’ve been busy the past few weeks, mainly with school but I’ve had spare time to have fun with.

I went to NYC for “A State of Trance 450″ which was a big party celebrating an electronic radio show. I had a blast, 9PM-5AM was not enough! Wished I could’ve gone to the next night, but I had to get back for Easter.

Here are some videos I took:

Continue reading

Share and Enjoy:
  • Print
  • Digg
  • Twitter
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Mixx
Posted in Life | Leave a comment

Accessing a listview’s Items From Another Thread

The Problem at Hand

The other day I had a simple problem that I couldn’t seem to find an answer to online. I had a background worker running on a thread that needed to access a collection of listview items. The problem should be evident to most developers, I cannot access a control that was created via another thread.

If you try, you will get this all too familiar error:

“Cross-thread operation not valid: Control ‘listView1′ accessed from a thread other than the thread it was created on.”

What was my solution?

Create a delegate that returns the collection in a string list. Simple, yes, effective? You bet.

private delegate List GetListViewDelegate();

        private void btnStartThread_Click(object sender, EventArgs e)
        {
            //Start the worker thread
            var myWorker = new BackgroundWorker();
            myWorker.DoWork += WorkerThread;
            myWorker.RunWorkerAsync();
        }

        private void WorkerThread(object sender, DoWorkEventArgs e)
        {
            //Grab the list via the delegate I created
            var myList = (List)Invoke(new GetListViewDelegate(GetListViewItems));
            foreach (string item in myList)
            {
                MessageBox.Show(item);
            }
        }

        public List GetListViewItems()
        {
            //Return the list back to the delegate
            var pathList = new List();
            foreach (ListViewItem item in listView1.Items)
                pathList.Add(item.Text);
            return pathList;
        }

PLEASE NOTE: My syntax highlighter omitted the <string> type elements. “List” should be “List<string>”!

Solution Files

I’ve included a source file so you can try it out yourself.
Download it here

Share and Enjoy:
  • Print
  • Digg
  • Twitter
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Mixx
Posted in C#, Tips, Tutorials | Leave a comment

ASOT 450 in a few weeks!

Just about a week and a half away! So excited! Taking a bus down to NYC from Boston at 4PM, then back at 6AM the next morning.

Share and Enjoy:
  • Print
  • Digg
  • Twitter
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Mixx
Posted in Life | Leave a comment