public bool ComboPWM(LegoPWM pwm1, LegoPWM pwm2, LegoChannel channel) { uint nib1, nib2, nib3, nib4; //set nibs nib1 = 1 << 2 | (uint)channel; nib2 = (uint)pwm1; nib3 = (uint)pwm2; nib4 = 0xf ^ nib1 ^ nib2 ^ nib3; return(sendMessage((ushort)nib1, (ushort)nib2, (ushort)nib3, (ushort)nib4, (uint)channel)); }
public bool SingleOutputPWM(LegoPWM pwm, LegoPWMOutput output, LegoChannel channel) { uint nib1, nib2, nib3, nib4; //set nibs nib1 = toggle[(uint)channel] | (uint)channel; nib2 = (uint)LegoMode.SINGLE_OUTPUT_PWM | (uint)output; nib3 = (uint)pwm; nib4 = 0xf ^ nib1 ^ nib2 ^ nib3; return(sendMessage((ushort)nib1, (ushort)nib2, (ushort)nib3, (ushort)nib4, (uint)channel)); }