EtherMania.com.WeatherShield1.sendCommand C# (CSharp) Method

sendCommand() private method

private sendCommand ( commands command, Byte parameter ) : void
command commands
parameter Byte
return void
        private void sendCommand(commands command, Byte parameter)
        {
            /* We start sending the first high level bit */
            if (!m_dataPort.Active)
                m_dataPort.Active = true;
            m_dataPort.Write(true);
            pulseClockPin();

            /* The first byte is always 0xAA... */
            sendByte(0xAA);

            /* ... then is the address... */
            sendByte(m_deviceAddress);

            /* ... then is the command ... */
            sendByte((Byte)command);

            /* ... and the parameter ... */
            sendByte(parameter);

            /* And this is the last low level bit required by the protocol */
            m_dataPort.Write(false);
            pulseClockPin();
        }