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

📄 main.cpp

📁 嵌入式计算机及接口技术
💻 CPP
字号:
/****************************************Copyright (c)**************************************************
**                               Guangzou ZLG-MCU Development Co.,LTD.
**                                      graduate school
**                                 http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name:			main.c
** Last modified Date:  2004-09-16
** Last Version:		1.0
** Descriptions:		The main() function example template
**
**------------------------------------------------------------------------------------------------------
** Created by:			Chenmingji
** Created date:		2004-09-16
** Version:				1.0
** Descriptions:		The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:该程序是为了实现LPC2138的28脚输出高低电平,使得跟该引脚相接的LED闪烁
** 
********************************************************************************************************/
#include "config.h"

#include "Pin_LPC2138.h"


Pin_LPC2138 PIN028;

  
 

/************初时化引脚************/

void Ini_Pin()
{


  PIN028.SetPinTag("P002");// PIN028表示28脚,更加具体其是P1.25
  PIN028.Function=0;//表示选中的是0号功能,表示GPIO,做普通的输入和输出用
  PIN028.Dirction=PinDirOut;//表示方向为输出
  PIN028.Ini();  //
  
  
 
 };






int main (void)
{  
 

Ini_Pin();



PIN028.Set(); //该引脚置高电平

while(1)
{

 if ( PIN028.PinValue()==1) //判断当前脚的设置值
      PIN028.Clear();////该引脚置低电平
 else   PIN028.Set();

 DelayNS(10000000);

};
      return 0;

}
/*********************************************************************************************************
**                            End Of File
********************************************************************************************************/

⌨️ 快捷键说明

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