Untitled

 avatar
unknown
c_cpp
4 years ago
416 B
5
Indexable
/*
connection
 dip switch P0.16 to P0.23
 LED P0.6 to P0.15
*/
 
#include “lpc214x.h”
 
void delay (unsigned long int h)
{
    unsigned long int i,j;
    for(j=0;j<h;j++)
        for(i=0;i<5000;i++)
}
 
int main{}
{
    int a;
    IODIR0 = 0x0000ff00;
    while(1)
    {
        a = IOPIN0 & 0x00ff0000;
        IOCLR0 = 0xffffffff;
        IOSET0 = a>>0;
        delay(1000);
    }
}
Editor is loading...