code: function setDutyCycle()
  {
  	myMOSFETsensor.setDutyCycle(g_cycleNum);
  	if (g_addnumBool)
  		g_cycleNum += 0.1;
  	else
  		g_cycleNum -= 0.1;
  	g_cycleCount++;
  	if (g_cycleCount > 10)
  	{
  		g_addnumBool = !g_addnumBool;
  		g_cycleCount = 0;
  	}
  	else
  		setTimeout(setDutyCycle, 100);
  }
docs: We start with a duty cycle of 0.0 (off) and increment to 1.0 (on) Then we take it back down, starting with a duty cycle of 1.0 (on) and decrement to 0.0 (off)