// Send byte to the 74HCT595 demux private void latch_tx() { MotorLatch.Write(false); for (int i = 8; i >= 0; i--) { MotorClk.Write(false); MotorData.Write((latch_state & (1 << i)) > 0); MotorClk.Write(true); } MotorLatch.Write(true); }
public void Dispose() { latch_state = 0; latch_tx(); //if (UsedDriver == Drivers.Driver1 || UsedDriver == Drivers.Both) //{ // Motor1A.Dispose(); // Motor1B.Dispose(); //} //if (UsedDriver == Drivers.Driver2 || UsedDriver == Drivers.Both) //{ Motor2A.Dispose(); Motor2B.Dispose(); //} MotorLatch.Dispose(); MotorEnable.Dispose(); MotorClk.Dispose(); MotorData.Dispose(); }