making_the_onboard-led_blink_on_a_lpc1115
/*
===============================================================================
 Name        : main.c
 Author      : 
 Version     :
 Copyright   : Copyright (C) 
 Description : main definition
===============================================================================
*/
 
#ifdef __USE_CMSIS
#include "LPC11xx.h"
#endif
 
#include <cr_section_macros.h>
#include <NXP/crp.h>
 
// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
 
void s(int d){
  volatile int j = 0;
  for(j=1;j<d*100000;j++);
}
void on(){
	LPC_GPIO0->DATA |= 1<<7;
}
void off(){
	LPC_GPIO0->DATA &= ~(1<<7);
}
void l(){
  on();
  s(6);
  off();
  s(2);
}
void c(){
  on();
  s(2);
  off();
  s(2);
}
void p(){
  s(4);
}
 
int main(void) {
	volatile int i;
	LPC_GPIO0->DIR |= 1<<7;
	while(1) {
		l();l();l();p();
		l();c();l();c();p();
		c();l();p();
		l();l();p();
		c();l();c();c();p();
		c();l();c();c();p();
		c();l();p();
		l();c();c();c();p();
		c();c();c();p();
		for(i=0;i<9;i++)p();
	}
	return 0;
}
making_the_onboard-led_blink_on_a_lpc1115.txt · Last modified: 2013/06/12 16:44 by phil