当前位置: 首页>>代码示例>>C++>>正文


C++ LED_Init函数代码示例

本文整理汇总了C++中LED_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ LED_Init函数的具体用法?C++ LED_Init怎么用?C++ LED_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LED_Init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BSP_Init

void  BSP_Init(void)
{
	Key_Init();
	LED_Init();
	//MyLCD_Init();
  Touch_Init();
  SysTick_Init();
}
开发者ID:Samwuzhitao,项目名称:My_DISCO407_Github,代码行数:8,代码来源:bsp.c

示例2: PF_init

void PF_init()
{
  LED_Init();
  _channel = 1;
  _toggle = 0;
  IR_DDR |= (1<<IR_PIN_DD);
  IR_PORT &= ~(1<<IR_PIN);
}
开发者ID:NosDE,项目名称:powerfunctions,代码行数:8,代码来源:PowerFunctions.c

示例3: main

/*----------------------------------------------------------------------------
  Main: Initialize and start RTX Kernel
 *---------------------------------------------------------------------------*/
int main (void) {

	LED_Init();                           /* Initialize LEDs                   */

  t_ledOn  = osThreadCreate(osThread(ledOn),  NULL);  /* start task 'ledOn'  */
  t_ledOff = osThreadCreate(osThread(ledOff), NULL);  /* start task 'ledOff' */
  osDelay(osWaitForever);
}
开发者ID:ggajoch,项目名称:stm32-sudoku,代码行数:11,代码来源:Blinky.c

示例4: SYSTEM_Init

/*初始化*/
void SYSTEM_Init(void)
{
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);//中断优先组
	GetDeviceSerialID();
	LED_Init();
//	BEEP_Init();
	SysTick_Config(SystemCoreClock / 1000);
}
开发者ID:LiuHuiGitHub,项目名称:STM32F103VET6,代码行数:9,代码来源:system.c

示例5: main

 int main(void)
 { 
	u16 i,rxlen;
	u16 lenx;
	u8 key=0XFF;
	u8 upload=0;
	delay_init();	    	 //延时函数初始化	  
	uart_init(38400);	 	//串口初始化为9600
	USART2_Init(38400);	//初始化串口2
	LED_Init();				//初始化与LED连接的硬件接口
	KEY_Init();				//初始化与LED连接的硬件接口
   LCD_Init();				//初始化LCD
 	POINT_COLOR=RED;
	LCD_ShowString(30,20,200,16,16,"ALIENTEK STM32 ^_^");	
	LCD_ShowString(30,40,200,16,16,"NE0-6M GPS TEST");	
	LCD_ShowString(30,60,200,16,16,"[email protected]");
	LCD_ShowString(30,80,200,16,16,"KEY0:Upload NMEA Data SW");   	 										   	   
   	LCD_ShowString(30,100,200,16,16,"NMEA Data Upload:OFF");   
	if(Ublox_Cfg_Rate(1000,1)!=0)	//设置定位信息更新速度为1000ms,顺便判断GPS模块是否在位. 
	{
   		LCD_ShowString(30,120,200,16,16,"NEO-6M Setting...");
		while((Ublox_Cfg_Rate(1000,1)!=0)&&key)	//持续判断,直到可以检查到NEO-6M,且数据保存成功
		{
			USART2_Init(9600);				//初始化串口2波特率为9600(EEPROM没有保存数据的时候,波特率为9600.)
	  		Ublox_Cfg_Prt(38400);			//重新设置模块的波特率为38400
			USART2_Init(38400);				//初始化串口2波特率为38400 
			Ublox_Cfg_Tp(1000000,100000,1);	//设置PPS为1秒钟输出1次,脉冲宽度为100ms	    
			key=Ublox_Cfg_Cfg_Save();		//保存配置  
		}	  					 
	   	LCD_ShowString(30,120,200,16,16,"NEO-6M Set Done!!");
		delay_ms(500);
		LCD_Fill(30,120,30+200,120+16,WHITE);//清除显示 
	}
	while(1) 
	{		
		delay_ms(1);
		if(USART2_RX_STA&0X8000)		//接收到一次数据了
		{
			rxlen=USART2_RX_STA&0X7FFF;	//得到数据长度
			for(i=0;i<rxlen;i++)USART1_TX_BUF[i]=USART2_RX_BUF[i];	   
 			USART2_RX_STA=0;		   	//启动下一次接收
			USART1_TX_BUF[i]=0;			//自动添加结束符
			GPS_Analysis(&gpsx,(u8*)USART1_TX_BUF);//分析字符串
			Gps_Msg_Show();				//显示信息	
			if(upload)printf("\r\n%s\r\n",USART1_TX_BUF);//发送接收到的数据到串口1
 		}
		key=KEY_Scan(0);
		if(key==KEY0_PRES)
		{
			upload=!upload;
			POINT_COLOR=RED;
			if(upload)LCD_ShowString(30,100,200,16,16,"NMEA Data Upload:ON ");
			else LCD_ShowString(30,100,200,16,16,"NMEA Data Upload:OFF");
 		}
		if((lenx%500)==0)LED0=!LED0; 	    				 
		lenx++;	
	}											    
}	
开发者ID:FateMouse,项目名称:STM32-ATKNEO6MGPS,代码行数:58,代码来源:main.c

示例6: GPIO_LED

void GPIO_LED(void)
{
    SystemInit();

	LED_Init();
    while (1) {
        demo();
    }
}
开发者ID:coocox,项目名称:Mplib,代码行数:9,代码来源:GPIO_LED.c

示例7: rt_thread_entry_led2

static void rt_thread_entry_led2(void* parameter)
{
  LED_Init();  
  while (1)
  {  
    LEDTog(LED2);        
    rt_thread_delay(RT_TICK_PER_SECOND/3);        
  }
}
开发者ID:dengkuanchina,项目名称:STM32F107Board-rttproject,代码行数:9,代码来源:application.c

示例8: main

 int main(void)
 {
	u8 key;
	u16 i=0;
	u8 datatemp[SIZE];
 	SystemInit();
	delay_init(72);	     //延时初始化
	NVIC_Configuration();
 	uart_init(9600);
 	LED_Init();
 	KEY_Init();
	LCD_Init();
	AT24CXX_Init();		//IIC初始化 
	POINT_COLOR=RED;//设置字体为蓝色	   
	LCD_ShowString(60,50,"Mini STM32");	
	LCD_ShowString(60,70,"IIC TEST");	
	LCD_ShowString(60,90,"[email protected]");
	LCD_ShowString(60,110,"2011/1/1");			 
	while(AT24CXX_Check())//检测不到24c02
	{
		LCD_ShowString(60,130,"24C02 Check Failed!");
		delay_ms(500);
		LCD_ShowString(60,130,"Please Check!      ");
		delay_ms(500);
		LED0=!LED0;//DS0闪烁
	}
	LCD_ShowString(60,130,"24C02 Ready!");
	//显示提示信息
	LCD_ShowString(60,150,"KEY0:Write KEY2(WK_UP):Read");

	POINT_COLOR=BLUE;//设置字体为蓝色	  
	while(1)
	{
		key=KEY_Scan();
		if(key==1)//KEY0按下,写入24C02
		{
			LCD_Fill(0,170,239,319,WHITE);//清除半屏    
 			LCD_ShowString(60,170,"Start Write 24C02....");
			AT24CXX_Write(0,(u8*)TEXT_Buffer,SIZE);
			LCD_ShowString(60,170,"24C02 Write Finished!");//提示传送完成
		}
		if(key==3)//KEY_UP按下,读取字符串并显示
		{
 			LCD_ShowString(60,170,"Start Read 24C02.... ");
			AT24CXX_Read(0,datatemp,SIZE);
			LCD_ShowString(60,170,"The Data Readed Is:  ");//提示传送完成
			LCD_ShowString(60,190,datatemp);//显示读到的字符串
		}
		i++;
		delay_ms(10);
		if(i==20)
		{
			LED0=!LED0;//提示系统正在运行	
			i=0;
		}		   
	}
 }
开发者ID:itecwip,项目名称:stm32f1_stuff,代码行数:57,代码来源:main.c

示例9: start_task

void start_task(void *pdata)
{	
	
	OS_CPU_SR cpu_sr = 0;
	pdata = pdata;
	u8 err;
	delay_init(168);

	USART1_Init();//初始化
	LED_Init();
	BEEP_Init();

	pringf("Hello world\n");

	OS_ENTER_CRITICLE();	//进入临界区 无法被中断打断

	//创建系统定时器
	pTmrLed = OSTmrCreate(	0,//dly 计时前的延迟
				OS_TMR_CFG_TICKS_PER_SEC/2,//周期 宏本身表示1s
				OS_TMR_OPT_PERIODIC,//周期模式
				(OS_TMR_CALLBACK)LedTmrCallback,
				NULL,
				NULL,
				&err
				);//定时器时间到了 自动调用回调函数
	pTmrBeep = OSTmrCreate(	0,
				OS_TMR_CFG_TICKS_PER_SEC/2,
				OS_TMR_OPT_PERIODIC,
				(OS_TMR_CALLBACK)BeepTmrCallback,
				NULL,
				NULL,
				&err
				);

	//启动定时器
	if( OSTmrStart(pTmrLED,&err) == OS_TRUE )
	{
		printf("LED TMR Start.\n");
	}
	else
		printf("LED TMR Fail.\n");

	if( OSTmrStart(pTmrBeep,&err) == OS_TRUE )
	{
		printf("BEEP TMR Start.\n");
	}
	else
		printf("BEEP TMR Fail.\n");
	

	OS_EXIT_CRITICLE();		//退出临界区 可以被中断打断

	while(1)//一直延时 等待程序运行
		OSTimeDlyHMSM(0,0,0,500);
	

}
开发者ID:jessehui,项目名称:Advanced_C,代码行数:57,代码来源:main(task)14.c

示例10: main

 int main(void)
 {	
	delay_init();	    	 //延时函数初始化	
  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);// 设置中断优先级分组2
	LED_Init();		  	//初始化与LED连接的硬件接口
	OSInit();   
 	OSTaskCreate(start_task,(void *)0,(OS_STK *)&START_TASK_STK[START_STK_SIZE-1],START_TASK_PRIO );//创建起始任务
	OSStart();	
 }
开发者ID:FateMouse,项目名称:STM32-ExampleCodeUCOSIITask,代码行数:9,代码来源:main.c

示例11: EXTIX_Init

//外部中断初始化程序
//初始化PE2~4,PA0为中断输入.
void EXTIX_Init(void)
{
	NVIC_InitTypeDef   NVIC_InitStructure;
	EXTI_InitTypeDef   EXTI_InitStructure;
	
	LED_Init();
  
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);//使能SYSCFG时钟
	
 
	SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOC, EXTI_PinSource2);//PE2 连接到中断线2
	SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOC, EXTI_PinSource3);//PE3 连接到中断线3
	SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOE, EXTI_PinSource4);//PE4 连接到中断线4
	SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0);//PA0 连接到中断线0
	
  /* 配置EXTI_Line0 */
  EXTI_InitStructure.EXTI_Line = EXTI_Line0;//LINE0
  EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;//中断事件
  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; //上升沿触发 
  EXTI_InitStructure.EXTI_LineCmd = ENABLE;//使能LINE0
  EXTI_Init(&EXTI_InitStructure);//配置
	
	/* 配置EXTI_Line2,3,4 */
	EXTI_InitStructure.EXTI_Line = EXTI_Line2 | EXTI_Line3 | EXTI_Line4;
  EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;//中断事件
  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; //下降沿触发
  EXTI_InitStructure.EXTI_LineCmd = ENABLE;//中断线使能
  EXTI_Init(&EXTI_InitStructure);//配置
 
	NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;//外部中断0
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;//抢占优先级0
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02;//子优先级2
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//使能外部中断通道
  NVIC_Init(&NVIC_InitStructure);//配置
	
	NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQn;//外部中断2
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x03;//抢占优先级3
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02;//子优先级2
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//使能外部中断通道
  NVIC_Init(&NVIC_InitStructure);//配置
	
	
	NVIC_InitStructure.NVIC_IRQChannel = EXTI3_IRQn;//外部中断3
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x02;//抢占优先级2
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02;//子优先级2
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//使能外部中断通道
  NVIC_Init(&NVIC_InitStructure);//配置
	
	
	NVIC_InitStructure.NVIC_IRQChannel = EXTI4_IRQn;//外部中断4
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01;//抢占优先级1
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02;//子优先级2
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//使能外部中断通道
  NVIC_Init(&NVIC_InitStructure);//配置
	   
}
开发者ID:nishilv2,项目名称:stm32_smart_plane_self_single,代码行数:58,代码来源:exti.c

示例12: main

int main(void)
{
	LED_Init(LED_2 | LED_3);
	Beep_Init();
	SysTick_Init(1, SYSTICK_MS);
	LED_On(LED_2 | LED_3);
	Usart_Init();
	//Beep_On();
	SysTick_Delay(200, SYSTICK_MS);
	//Beep_Off();
	LED_Off(LED_2 | LED_3);
	Key_Init(KEY_S1 | KEY_S2 | KEY_S3 | KEY_S4);
	Keyboard_Init();
	//LCD_Init();	
	ADS1118_Init();
  while(1) 
	{		 
		
		printf("准备完毕 开始转换!\n");
		ADS1118_CS_Reset();
		while(!GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_6));
	    ConversionValue = ADS1118_Read(count);//8283  
		ADS1118_CS_Set();
        printf(" The  Value is 0X%08x ,%08d\n",ConversionValue,ConversionValue);
		ad=	ConversionValue*4.096/32768;
		printf("AD=%fV\n",ad);
		SysTick_Delay(1000, SYSTICK_MS);	
//		Keyboard_Loop();
//		//LCD_Clear(Color_White);
//		//LCD_Set_ForeColor(Color_Red);  	
//		//if(Keyboard_Scan() == KEYBOARD_S1) { LCD_Show_String(30,50,200,16,16, "Key Board Test");	}
//		if(Keyboard_Detect(KEYBOARD_S1, KEYBOARD_DOWN)) { printf("S1\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S2, KEYBOARD_DOWN)) { printf("S2\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S3, KEYBOARD_DOWN)) { printf("S3\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S4, KEYBOARD_DOWN)) { printf("S4\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S5, KEYBOARD_DOWN)) { printf("S5\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S6, KEYBOARD_DOWN)) { printf("S6\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S7, KEYBOARD_DOWN)) { printf("S7\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S8, KEYBOARD_DOWN)) { printf("S8\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S9, KEYBOARD_DOWN)) { printf("S9\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S10, KEYBOARD_DOWN)) { printf("S10\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S11, KEYBOARD_DOWN)) { printf("S11\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S12, KEYBOARD_DOWN)) { printf("S12\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S13, KEYBOARD_DOWN)) { printf("S13\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S14, KEYBOARD_DOWN)) { printf("S14\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S15, KEYBOARD_DOWN)) { printf("S15\r\n"); }
//		if(Keyboard_Detect(KEYBOARD_S16, KEYBOARD_DOWN)) { printf("S16\r\n"); }
//		//LCD_Set_ForeColor(Color_Green);  
//		//LCD_Show_String(30,70,200,16,16, "TFT-LCD test");	
//		//LCD_Set_ForeColor(Color_Blue);  
//		//LCD_Show_String(30,90,200,16,16, "www.doflye.net");
//		//LCD_Draw_Circle(100,180,20);	
//		//SysTick_Delay(1000, SYSTICK_MS);	

	} 
}
开发者ID:Ivy-End,项目名称:STM32-Template,代码行数:56,代码来源:main.c

示例13: main

int main(void)
{
	LED_Init();
	//KEY_Init();
	Create_Page_Table();
	Start_mmu();
	EINT0_2_11_init();
	while(1);
	return 1;
}
开发者ID:erhuoqiang,项目名称:armjz,代码行数:10,代码来源:main.c

示例14: USBD_USR_Init

/**
* @brief  USBD_USR_Init
*         Displays the message on LCD for host lib initialization
* @param  None
* @retval None
*/
void USBD_USR_Init(void)
{
  /* Initialize LEDs */
  LED_Init();

  LLIO_Init(115200);


  printf("\r\n\r\nUSB Device Library v1.1.0\r\n");
}
开发者ID:JamesHyunKim,项目名称:myCortex-STM32F4,代码行数:16,代码来源:usbd_usr.c

示例15: main

int main(void) {

    LED_Init();

    SysTick_Config(SystemCoreClock/1000);

    while(1) {}

    return 0;
}
开发者ID:hans-jorg,项目名称:tiva-tm4c123gxl-launchpad-cmsis,代码行数:10,代码来源:main.c


注:本文中的LED_Init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。