#ifdef __USE_CMSIS
#include "LPC13xx.h"
#include "clkconfig.h"
#include "gpio.h"
#include "config.h"
#include "timer32.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 ;
// TODO: insert other include files here
// TODO: insert other definitions and declarations here
int main(void) {
//considering an stepper motor with an step angle of 1.8 degree
//setting the pins of p2.0 to p2.3 as outputs[ATTACH=CONFIG]81867._xfImport[/ATTACH]
LPC_GPIO2->DIR |= 0x0000000F;
enable_timer32(0);//enable timer 0
while(1)//anticlockwise rotation
{
LPC_GPIO2->DATA = 0x00000006;
LPC_GPIO2->DATA = 0x00000003;
LPC_GPIO2->DATA = 0x00000009;
LPC_GPIO2->DATA = 0x0000000C;
delay32Ms(0,100);
}
return 0 ;
}