Project DescriptionTrack a CruiseControl.NET project and output build status to a device via serial (or USB with driver). Ideal for LCD light status / relay for lava lamps etc. It's a taskbar based application developed in C#, and has been developed with the Arduino Diecimila in mind.
Project Background & ScopeThis project is in 3 parts. 2 of those parts are software based, and the third is hardware based.
I wanted a easy and different way of monitoring a
CruiseControl.net project build status. I came across the
Arduino Diecimila - a USB controller board. I'm not an electronics boffin - but this board provides just the right level of entry for me. The board costs ~£25 (~$45) and comes with a simple IDE which allows you to program the board in its own language (akin to simple C), upload it and test it with a serial feedback monitor.
Seeing as its mid-November, what better way to monitor build status than with a colour-changing LED Christmas tree?! All I needed was a tri-colour LED, some wire, and a cheap & cheerful USB Xmas tree.
Armed with the board, I wrote a very simple program to accept a character input via the serial port, the character being either 'R', 'G', 'Y' or 'Z', which in turn provided output via 2 of the 13 onboard outputs to a tri-colour LED I had wired in. This gave me red ('R'), green ('G'), yellow ('Y') (the tri-colour LED allows both pins to take power, thus providing a near-approximation of yellow), and off ('Z').
Mentions: I'm not very good with hardware - so I have to credit
this page for providing me with all the hardware prompts I needed.
As an aside - this is the code I used to program the on-board controller on the Diecimila board:
int GreenPin = 13; //LED connected to digital pin 13
int RedPin = 12; //LED connected to digital pin 12
int val = 0;
void setup()
{
pinMode(GreenPin, OUTPUT);//digital pin set as output
pinMode(RedPin, OUTPUT);//digital pin set as output
Serial.begin(9600);
}
void loop(){
if(Serial.available()){
val = Serial.read();
if (val == 'R'){
digitalWrite(RedPin, HIGH); //LED turns on
digitalWrite(GreenPin, LOW); //LED turns off
}
else if (val =='Y'){
digitalWrite(RedPin, HIGH); //LED turns on
digitalWrite(GreenPin, HIGH); //LED turns on
}
else if (val =='Z'){
digitalWrite(GreenPin, LOW); //LED turns off
digitalWrite(RedPin, LOW); //LED turns off
}
else
{
digitalWrite(GreenPin, HIGH); //LED turns on
digitalWrite(RedPin, LOW); //LED turns off
}
Serial.print(val);
}
}
With all that done, the only thing left was a taskbar-based, .NET application which would poll CruiseControl.net and output the status to the board. This is the code that is provided here in the release section.