Netduino Traffic Light
Last week I got my GHI FEZ Internet of Things Kit, which includes – besides many accessory parts – a .NET-Microframework-powered Arduino-like board, the Netduino.
I started playing around with both the software and hardware, and the first thing that really worked was a very simple traffic light. It displays the light sequence red, red/yellow, green, yellow and back to red which is used in Germany. Although it is not that spectacular I’ve uploaded a short video showing the hardware setup and the light sequence.
This is the very simple code behind it:
using System; using System.Threading; using GHIElectronics.NETMF.FEZ; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; namespace NetduinoTrafficLights { public class TrafficLightsDE { public static OutputPort Red = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di1, false); public static OutputPort Yellow = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di0, false); public static OutputPort Green = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di3, false); public static void Main() { while (true) { Red.Write(true); Thread.Sleep(6000); Yellow.Write(true); Thread.Sleep(1000); Red.Write(false); Yellow.Write(false); Green.Write(true); Thread.Sleep(8000); Green.Write(false); Yellow.Write(true); Thread.Sleep(2000); Yellow.Write(false); } } } }
Over the next weeks and month I will play around with more of the kit’s accessory parts and I’ll continue posting code (and maybe videos) about that. If you like (or don’t like) the video, feel free to leave a comment.
Search
Categories
Tags
Arduino ATtiny blinking C# Code-Download Coding Converter email FEZ first steps GPIO Hardware ID12 James Java JSP jspinfo LCD LED Lights Linux microcontroller Netduino NETMF Network NewBase60 opensource Panda II PWM Python Raspberry Pi RFID RGB screen server shell slow motion Traffic Light video WS2812Blogroll
Archives
- December 2014 (1)
- January 2014 (1)
- March 2013 (1)
- December 2012 (1)
- October 2012 (2)
- September 2012 (3)
- June 2012 (3)
- May 2012 (1)
- April 2012 (3)
- March 2012 (1)
- February 2012 (1)
- December 2011 (1)
- November 2011 (1)
- October 2011 (1)
- September 2011 (1)
- August 2011 (2)
- July 2011 (3)
- June 2011 (3)