public bool SingleOutputTimeout(LegoFunction lfunction, LegoOutput output, LegoChannel channel) { uint nib1, nib2, nib3, nib4; //set nibs nib1 = toggle[(uint)channel] | (uint)channel; nib2 = (uint)LegoMode.SINGLE_PIN_TIMEOUT; nib3 = (uint)output << 2 | (uint)lfunction; nib4 = 0xf ^ nib1 ^ nib2 ^ nib3; return(sendMessage((ushort)nib1, (ushort)nib2, (ushort)nib3, (ushort)nib4, (uint)channel)); }
public bool SingleOutputCST(LegoCST pwm, LegoPWMOutput output, LegoChannel channel) { uint nib1, nib2, nib3, nib4; //set nibs nib1 = toggle[(uint)channel] | (uint)channel; nib2 = (uint)LegoMode.SINGLE_OUTPUT_CST | (uint)output; nib3 = (uint)pwm; nib4 = 0xf ^ nib1 ^ nib2 ^ nib3; return(sendMessage((ushort)nib1, (ushort)nib2, (ushort)nib3, (ushort)nib4, (uint)channel)); }
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 ComboMode(LegoSpeed blue_speed, LegoSpeed red_speed, LegoChannel channel) { uint nib1, nib2, nib3, nib4; //set nibs nib1 = toggle[(uint)channel] | (uint)channel; //nib1 = (uint)channel; nib2 = (uint)LegoMode.COMBO_DIRECT_MODE; nib3 = (uint)blue_speed | (uint)red_speed; nib4 = 0xf ^ nib1 ^ nib2 ^ nib3; return(sendMessage((ushort)nib1, (ushort)nib2, (ushort)nib3, (ushort)nib4, (uint)channel)); }