new presentation plan

Do ASP.Net example with the ambient orb. This works pretty well too.

I'll keep the twitter example as a WinForm application.


protected void changeOrb(object sender, EventArgs e)
{
SerialPort com = new SerialPort("COM4", 19200, Parity.None, 8, StopBits.One);
com.Open();

writeBuffer("~D", com);
writeBuffer(convertIntToChar(red.Value), com);
writeBuffer(convertIntToChar(green.Value), com);
writeBuffer(convertIntToChar(blue.Value), com);

com.Close();
}

private static char convertIntToChar(string value)
{
return (char) Convert.ToInt16(value);
}

private static void writeBuffer(char buffer, SerialPort com)
{
writeBuffer(buffer.ToString(), com);
}

private static void writeBuffer(string buffer, SerialPort com)
{
com.Write(buffer);
}

No comments posted yet.

Post a Comment

Please add 8 and 8 and type the answer here: