Jerry's Blog There's more to life than meets the eye..

12Jan/130

USB Devices not working in VirtualBox

Background
Recently, I installed Windows 8 on a VirtualBox. Everything seemed to work great until I tried to sync my phone. Since that did not work, I tried connecting a USB flash drive (memory flash card via my monitor's flash card reader). That did not work either. Then I tried connecting my video camera. No luck. Windows 8 would not recognize any of those devices. Device Manager in Windows 8 would have a warning icon next to the device in question.

After searching through forums and videos on YouTube I came across a badly made video (sorry forgot to note the link and now I can't find it) that had the answer. But it was not emphasized.

Solution

  1. Make sure your virtual machine is shut down
  2. Navigate to your virtual machine's Settings
  3. Click on USB
  4. Make sure both Enable USB Controller and Enable USB 2.0 (EHCI) Controller are checked

virtualbox-settings

Filed under: How To No Comments
22Jan/110

My first project with Netduino – Quiz Show Buzzer System

For the first Netduino/Arduino project I wanted to create a Quiz Show Buzzer System. In order to create this system I had to find some materials. If you have an old PC case, it can be a great source :).

Materials

  • (1) Netduino
  • (2) Power/Reset switch from old PC case
  • (2) LEDs (red/green) from old PC case
  • (1) PC/USB Power source

Hardware Setup

  1. Connect Green LED + (positive) wire to Netduino's digital I/O port 0 (zero)
  2. Connect Green LED - (negative) wire to Gnd port (I used one of the two on the Analog In side)
  3. Connect Red LED + wire to digital I/O port 7
  4. Connect Red LED - wire to the same Gnd port
  5. Connect Switch 1 + wire to Analog In port 5
  6. Connect Switch 1 - wire to same Gnd port
  7. Connect Switch 2 + wire to Analog In port 0 (zero)
  8. Connect Switch 2 - wire to same Gnd port
  9. Connect Netduino with PC using USB (for power)

Software

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace NetduinoApplication1
{
    public class Program
    {

        static OutputPort led;
        static OutputPort greenLed;
        static OutputPort redLed;

        public static void Main()
        {
            led = new OutputPort(Pins.ONBOARD_LED, false);
            greenLed = new OutputPort(Pins.GPIO_PIN_D0, false);
            redLed = new OutputPort(Pins.GPIO_PIN_D7, false);

            InterruptPort blueSWi = new InterruptPort(Pins.GPIO_PIN_A5, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
            blueSWi.OnInterrupt += new NativeEventHandler(blueSWi_OnInterrupt);

            InterruptPort orangeSWi = new InterruptPort(Pins.GPIO_PIN_A0, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
            orangeSWi.OnInterrupt += new NativeEventHandler(orangeSWi_OnInterrupt);

            InterruptPort swi = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
            swi.OnInterrupt += new NativeEventHandler(swi_OnInterrupt);

            Thread.Sleep(Timeout.Infinite);

        }

        static void orangeSWi_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            if (data2 == 0)
            {
                if (!greenLed.Read())
                {
                    redLed.Write(true);
                }
            }
        }

        static void blueSWi_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            if (data2 == 0)
            {
                if (!redLed.Read())
                {
                    greenLed.Write(true);
                }
            }

        }

        static void swi_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            if (data2 == 0)
            {
                led.Write(false);
                greenLed.Write(false);
                redLed.Write(false);
                Thread.Sleep(100);
            }
        }

    }
}

Operability

The two external switches are used by players of the Quiz Show game. The internal Netduino's switch is used by the Host to reset the state of the system. This system enables the Host to know which player buzzed in first.

Media

Video

Images

Conclusion

This was a nice little quick project that helped me get my feet wet in Netduino. Let me know if you need any part of it explained further.

11Nov/09Off

What is teamwork?

In a post on Harvard Business Blog site, Steven DeMaio talks about the Art of Learning from a Colleague. Although, he is talking about working together in the copy writing field, the topic applies to Software Development and other domains.

In more agile software development teams, developers exercise pair programming. As Steven experienced getting the work done in a shorter amount of time, likewise, the pair programming team generates higher quality code.

In my experience working together with another person on any task/project has always yielded better results then doing it alone.