⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xtest03_2.c

📁 AT91sam7s 256 B/D example
💻 C
字号:
/* ========================================================================== */
/*	  Xtest03_2.c : Access to Absolute Address of I/O Register(2)         */
/* ========================================================================== */
/*			  Designed and programmed by Duck-Yong Yoon in 2007.  */

#include "AT91SAM7S256.h"
#include "lib_AT91SAM7S256.h"
#include "OK7S256ads.h"

int main(void)
{
  MCU_initialize();				// initialize AT91SAM7S256 & kit

  while(1)
    { Beep();					// beep 

      *AT91C_PIOA_CODR = 0x00000001;		// PA0=0(LED1 on) 
      Delay_ms(1000);
      *AT91C_PIOA_SODR = 0x00000001;		// PA0=1(LED1 off)
      Delay_ms(1000);

      *AT91C_PIOA_CODR = 0x00000002;		// PA1=0(LED2 on) 
      Delay_ms(1000);
      *AT91C_PIOA_SODR = 0x00000002;		// PA1=1(LED2 off)
      Delay_ms(1000);

      *AT91C_PIOA_CODR = 0x00000003;		// PA1=PA0=0(LED2 and LED1 on)
      Delay_ms(1000);
      *AT91C_PIOA_SODR = 0x00000003;		// PA1=PA0=1(LED2 and LED1 off)
      Delay_ms(1000);
    }
}

⌨️ 快捷键说明

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