Main Site Documentation

Multicolor LED and fadeTime


#1

Hi guys
im just looking at the LED and im trying to get it to fade from one colour to another. Im using the FadeOnce Method, but im not really understanding the fadeTime part of the method. It doesnt take an int as its a System.Timespan call. How should it use this method?
Probably a really stupid question but ive gotta learn somehow :slight_smile:


#2

There are several overloads on the TimeSpan constructor, see http://msdn.microsoft.com/en-us/library/ee432723.aspx

For example:


TimeSpan ts = new TimeSpan(0,0,1);

will give you a one second fade.


#3

ahhhh now i get it :slight_smile: i was expecting that it needed a milisecond count as an overload (similar to a thread.sleep)
many thanks for the pointer ransomhall.

Hugh