When I try to set the dim level to 130,140,150,160 it lowers to minimum. On the rest of the values most work as they should. I want to have at least 25 different dim levels. When I try to write out the chars for the non working levels it just writes out "" or " ".
Here is my code. Am I doing something wrong here? Or should I just look for working chars?
Code: Select all
public void Dim(int deviceId, int level)
{
if (level > 25)
{
throw new ArgumentException("Max value is 25");
}
else if(level < 0)
{
throw new ArgumentException("Min value is 0");
}
if (level == 0)
{
TelldusNETWrapper.tdTurnOff(deviceId);
}
else
{
var charLevel = Convert.ToChar(level*11);
TelldusNETWrapper.tdDim(deviceId, charLevel);
}
}
Ludwig