Datasheet

2011 Microchip Technology Inc. DS22228B-page 23
MCP2200
2.3.1.25 WritePort
Function:
bool SimpleIOClass::WritePort(unsigned int portValue)
EXAMPLE 2-25:
Summary: Writes a value to the GPIO port.
Description: Writes the GPIO port. This provides a means to write all pins at simultaneously, instead of one-by-
one.
Precondition: Must be previously configured as an output via a
ConfigureIO call. VID and PID must be previously
set via a call to
InitMCP2200(VID, PID).
Parameters:
portValue - byte value to set on the port.
Returns: This function returns True if the transmission is successful and returns False if the transmission fails.
Remarks: None.
if (SimpleIOClass::WritePort (0x5A))
{
lblStatusBar->Text = “Success”;
}
else
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;