NXP_LPC1114_LED light program

Publisher:JoyfulSerenadeLatest update time:2015-07-13 Source: 51heiKeywords:NXP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
#include "LPC11XX.h"
#include "gpio.h"
#include "main.h"
void Delay_Sec(u8 Time)
{
 u16 and;
    while(Time)
  {
   for(i=0;i<3000000;i++);
   Time--;
  }
}
void Delay_Ms(u16 Time)
{
 u16 and;
 while(Time)
 {
  for(i=0;i<3000;i++);
  Time--;
 }
}
int main(void)
{
 SystemInit(); //System initialization - mainly setting the main clock
 GPIOInit(); //IO port initialization--mainly to turn on the GPIO clock
 
 //GPIOSetDir( 0, 3, 1 ); //Set P0.3 to output (LPC1114 MCU, output needs to be set to 1, input needs to be set to 0)
 LPC_GPIO0->DIR |= (0x1<<3); //Set P0.3 to output
 while(1)
 {
  //GPIOSetValue( 0, 3, 0 ); //Write 0 to P0.3
  LPC_GPIO0->DATA &= ~(0x1<<3); //Write 0 to P0.3
  //for(i=0;i<0xFFFFF;i++); //delay
  Delay_Ms(1000); //delay
  //GPIOSetValue( 0, 3, 1 ); //Write 1 to P0.3
  LPC_GPIO0->DATA |= (0x1<<3); //Write 1 to P0.3
  //for(i=0;i<0xFFFFF;i++); //delay
  Delay_Ms(1000); //delay
  }
}
Keywords:NXP Reference address:NXP_LPC1114_LED light program

Previous article:Design of temperature control system for high-precision biochemical analyzer based on ARM9
Next article:stm32 ultrasonic ranging program

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号