main.c

来自「一些简单的c51程序」· C语言 代码 · 共 26 行

C
26
字号
sfr P1 = 0x90;          /* SFR definition for Port 1 */
sfr P3 = 0xB0;          /* SFR definition for Port 3 */

/*------------------------------------------------
MAIN C Function
------------------------------------------------*/
void main (void)
{
unsigned char pval;     /* temp variable for port values */

P1 = 0xFF;              /* Setup P1 for Input */

/*--------------------------------------
Use the Toolbox buttons in the debugger
to change the value of P1.  Open the
Port 1 and Port 3 dialogs from the
Peripherals Menu to view their status.
--------------------------------------*/
while (1)
  {
  pval = P1;            /* Read P1 into pval */
  P3 = pval;            /* Write pval to P3 */
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?