/*-----------------------------------------------------------------------------
Definitions for P1 (8 bits), P1.0, and P1.1.
-----------------------------------------------------------------------------*/
sfr P1 = 0x90; /* SFR for P1 */
sbit P1_0 = P1^0; /* SFR for P1.0 */
sbit P1_1 = P1^1; /* SFR for P1.1 */
/*-----------------------------------------------------------------------------
MAIN C function
-----------------------------------------------------------------------------*/
void main (void)
{
P1_0 = 1; /* Configure P1.0 as an input */
/*-----------------------------------------------
This loop reads P1.0 and writes the value read
to P1.1.
Open the Port 1 Dialog from the Peripherals Menu
and change the value of the P1.0 Pin. When you
set P1.0 LO, P1.1 outputs LO. When you set
P1.0 HI, P1.1 outputs HI.
-----------------------------------------------*/
while (1)
{
P1_1 = P1_0; /* Copy P1.0 to P1.1 */
}
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/ |