欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: LPC1767走馬燈 [打印本頁]

作者: 978265211    時間: 2016-3-21 08:56
標題: LPC1767走馬燈
#include"lpc17xx.h"
#include"cmsis_os.h"
#include"GPIO_LPC17xx.h"
#include"core_cm3.h"
/************ delay function************/


void YIWEI(uint32_t rout)
{
uint32_t i,rout_1;
rout_1=rout;
for(i=0;i<6;i++)
{
  GPIO_PortWrite(2,0x000000ff,rout_1);
  osDelay(1000);
  
  rout_1=~((~rout_1)<<1);
}
}
/*******function body thread_1********/
void Thread_1(void const *arg)
{
uint32_t rout;   //p2 low input
LPC_GPIO2->FIODIR=0x00000fff;     //p2.0~p2.11 out mode

while(1)
{
  /*******************u5***************/
GPIO_PortWrite(2,0x00000fff,0x00000fff);     //init u5,u6,u7,all of the LED are OFF
GPIO_PortWrite(2,0x00000fff,0x000008ff);   //shut u6,u7,and choose u5   
rout=0x000008fb;
YIWEI(rout);   //led_on one by one

/**********************u6******************/
GPIO_PortWrite(2,0x00000fff,0x00000fff);   //init u5,u6,u7,all of the LED are OFF   
rout=0x000004fb;   
GPIO_PortWrite(2,0x00000fff,0x000004ff);   //shut u5,u7,and choose u6
YIWEI(rout);

/******************************************/


/**********************u7******************/
GPIO_PortWrite(2,0x00000fff,0x00000fff);
rout=0x000001fb;
GPIO_PortWrite(2,0x00000fff,0x000001ff);
YIWEI(rout);
}
}
/*******function body thread_2********/
void Thread_2(void const *arg)
{
while(1)
{
  osDelay(500);
}


}
osThreadDef (Thread_1, osPriorityNormal, 1, 0);
osThreadDef (Thread_2, osPriorityNormal, 1, 0);

/*******creat thread function******/


int main(void)
{
SystemInit();//system init function
osThreadCreate (osThread (Thread_1), NULL);
osThreadCreate (osThread (Thread_2), NULL);
while(1)
{

}

}






歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1