Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ===============================================================================
- Name : main.c
- Author :
- Version :
- Copyright : Copyright (C)
- Description : main definition
- ===============================================================================
- */
- #ifdef __USE_CMSIS
- #include "LPC17xx.h"
- #endif
- int contador1000=1, compara=0;
- int main(void) {
- // TODO: insert code here
- LPC_GPIO0->FIODIR |= (1 << 22); // P0[22] COMO SALIDA
- SysTick_Config(SystemCoreClock/1000);
- while(1) {
- if(!contador1000)
- {
- if(LPC_GPIO0->FIOPIN&(1 << 22))
- {
- LPC_GPIO0->FIOCLR = (1 << 22);// P0[22] = 0
- }
- else
- {
- LPC_GPIO0->FIOSET = (1 << 22); // P0[22] = 1
- }
- contador1000 = 0;
- }
- }
- return 0 ;
- }
- void SysTick_Handler(void)
- {
- contador1000 = (contador1000+1)%1000;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement