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

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.

7Dec/100

Dan Pink on Motivation via cartoon drawing

Filed under: Motivation No Comments
7Dec/100

Barry Schwartz on the paradox of choice

Filed under: Learning No Comments
7Aug/100

How did the Bible Come Together and How Much Trust Can We Put in it?

How did the Bible Come Together and How Much Trust Can We Put in it?

13Mar/10Off

The Pilgrim’s Progress

I've heard this story before but never read it. Now I'm reading it. I love how John Bunyan is using general terms for the names of characters. Such as Obstinate, Help, Worldly-wiseman, Good-will, Interpreter, and others (haven't gotten to the end of the book yet).

Here's the whole book (in PDF) for those that would be interested in reading it:
The Pilgrim's Progress

23Dec/090

Randy Pausch Lecture: Time Management

23Dec/090

Randy Pausch Last Lecture: Achieving Your Childhood Dreams

13Dec/090

W. Edwards Deming on Management

"A manager of people needs to understand that all people are different. This is not ranking people. He needs to understand that the performance of anyone is governed largely by the system that he works in, the responsibility of management. A psychologist that possesses even a crude understanding of variation as will be learned in the experiment with the Red Beads (Ch. 7) could no longer participate in refinement of a plan for ranking people."

This is something I'll need to do more research of. As I believe it is to be true.

Taken from http://en.wikipedia.org/wiki/W._Edwards_Deming

22Nov/090

Discovering the will of God for my life

I am looking for what God wants me to do. What should I be passionate for? Is His will general or specific for each person?

Here's a verse to get me going:
In every thing give thanks: for this is the will of God in Christ Jesus concerning you.
1 Thessalonians 5:18 (KJV)

11Nov/090

Dan Pink on Motivation

"There's a mismatch between what Science knows and what Business does"