Mikroelektronika MIKROE-724 データシート

ページ / 726
422
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Expander_Write_PortA
Expander_Write_PortB
Prototype
sub procedure Expander_Write_PortA(dim ModuleAddress, Data as byte)
Description The function writes byte to Port Expander’s PortA.
Parameters 
ModuleAddress
: Port Expander hardware address, see schematic at the bottom of this page 
Data
: data to be written 
Returns
Nothing.
Requires
Port Expander must be initialized. See Expander_Init.
Port  Expander’s  PortA  should  be  configured  as  output.  See  Expander_Set_DirectionPortA  and 
Expander_Set_DirectionPortAB routines.
Example
‘ Write a byte to Port Expander’s PORTA
...
Expander_Set_DirectionPortA(0,$00)    ‘ set expander’s porta to be output
...
Expander_Write_PortA(0, $AA)
Notes
None.
Prototype
sub procedure Expander_Write_PortB(dim ModuleAddress, Data as byte)
Description The function writes byte to Port Expander’s PortB.
Parameters 
ModuleAddress
: Port Expander hardware address, see schematic at the bottom of this page 
Data
: data to be written 
Returns
Nothing.
Requires
Port Expander must be initialized. See Expander_Init.
Port  Expander’s  PortB  should  be  configured  as  output.  See  Expander_Set_DirectionPortB  and 
Expander_Set_DirectionPortAB routines.
Example
‘ Write a byte to Port Expander’s PORTB
...
Expander_Set_DirectionPortB(0,$00)   ‘ set expander’s portb to be output
...
Expander_Write_PortB(0,$55)
Notes
None.