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


C++ LED_Off函数代码示例

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


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

示例1: ui_init

void ui_init(void)
{
	LED_On(LED0);
	LED_Off(LED1);
}
开发者ID:Timvrakas,项目名称:samd21_gcc,代码行数:5,代码来源:ui.c

示例2: ui_process

void ui_process(uint16_t framenumber)
{
	bool b_btn_state, success;
	static bool btn_last_state = false;
	static bool sequence_running = false;
	static uint8_t u8_sequence_pos = 0;
	uint8_t u8_value;
	static uint16_t cpt_sof = 0;

	if ((framenumber % 1000) == 0) {
		LED_On(LED0);
	}
	if ((framenumber % 1000) == 500) {
		LED_Off(LED0);
	}
	/* Scan process running each 2ms */
	cpt_sof++;
	if ((cpt_sof % 2) == 0) {
		return;
	}

	/* Uses buttons to move mouse */
	if (!ioport_get_pin_level(GPIO_PUSH_BUTTON_1)) {
		udi_hid_mouse_moveY(-MOUSE_MOVE_RANGE);
	}

	/* SW0 down to send keys sequence */
	b_btn_state = (!ioport_get_pin_level(GPIO_PUSH_BUTTON_1));
	if (b_btn_state != btn_last_state) {
		btn_last_state = b_btn_state;
		sequence_running = true;
	}

	/* Sequence process running each period */
	if (SEQUENCE_PERIOD > cpt_sof) {
		return;
	}
	cpt_sof = 0;

	if (sequence_running) {
		/* Send next key */
		u8_value = ui_sequence[u8_sequence_pos].u8_value;
		if (u8_value!=0) {
			if (ui_sequence[u8_sequence_pos].b_modifier) {
				if (ui_sequence[u8_sequence_pos].b_down) {
					success = udi_hid_kbd_modifier_down(u8_value);
				} else {
					success = udi_hid_kbd_modifier_up(u8_value);
				}
			} else {
				if (ui_sequence[u8_sequence_pos].b_down) {
					success = udi_hid_kbd_down(u8_value);
				} else {
					success = udi_hid_kbd_up(u8_value);
				}
			}
			if (!success) {
				return; /* Retry it on next schedule */
			}
		}
		/* Valid sequence position */
		u8_sequence_pos++;
		if (u8_sequence_pos >=
			sizeof(ui_sequence) / sizeof(ui_sequence[0])) {
			u8_sequence_pos = 0;
			sequence_running = false;
		}
	}
}
开发者ID:Timvrakas,项目名称:samd21_gcc,代码行数:69,代码来源:ui.c

示例3: ui_powerdown

void ui_powerdown(void)
{
	LED_Off(LED0_GPIO);
	LED_Off(LED1_GPIO);
}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:5,代码来源:ui.c

示例4: ui_com_close

void ui_com_close(uint8_t port)
{
	UNUSED(port);
	LED_Off(LED1);
}
开发者ID:Timvrakas,项目名称:samd21_gcc,代码行数:5,代码来源:ui.c

示例5: ui_stop_read

void ui_stop_read(void)
{
	LED_Off(LED1);
}
开发者ID:Timvrakas,项目名称:samd21_gcc,代码行数:4,代码来源:ui.c

示例6: ui_com_close

void ui_com_close(uint8_t port)
{
	LED_Off(LED2);
	LED_Off(LED3);
}
开发者ID:kerichsen,项目名称:asf,代码行数:5,代码来源:ui.c

示例7: ui_init

void ui_init(void)
{
	// Initialize LEDs
	LED_On(LED0_GPIO);
	LED_Off(LED1_GPIO);
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:6,代码来源:ui.c

示例8: ui_com_close

void ui_com_close(uint8_t port)
{
	LED_Off(LED1_GPIO);
}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:4,代码来源:ui.c

示例9: ui_stop_write

void ui_stop_write(void)
{
	LED_Off(LED2_GPIO);
}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:4,代码来源:ui.c

示例10: ModbusSaver

//Обрабатываем значения HoldingRegisters
void ModbusSaver()
{
	switch (usRegHoldingBuf[MB_OFFSET+MB_COMMAND])
	{
		case 1:	
			wdt_enable(WDTO_15MS); // enable watchdog
			while(1); // wait for watchdog to reset processor break;
			break;
			
		case 2:
			ADXL345_Calibrate();
			break;
	}
	
	usRegHoldingBuf[MB_OFFSET+MB_COMMAND] = 0;
	
	if (usRegHoldingBuf[MB_OFFSET+MB_LED_BLUE])
	{
		LED_On(LED_BLUE);
	}
	else
	{
		LED_Off(LED_BLUE);
	}
	
	if (usRegHoldingBuf[MB_OFFSET+MB_LED_GREEN])
	{
		LED_On(LED_GREEN);
	}
	else
	{
		LED_Off(LED_GREEN);
	}
	
	if (bit_is_set(usRegHoldingBuf[MB_OFFSET+MB_SOUND], 0))
	{
		Sound_On();
	}
	else
	{
		Sound_Off();
	}
	
	if (usRegHoldingBuf[MB_OFFSET+MB_ALL]<16000UL)
	{
		usRegHoldingBuf[MB_OFFSET+MB_ALL]=16000UL;
	}
	
	
	if (bit_is_set(usRegHoldingBuf[MB_OFFSET+MB_MANUAL], 4))
	{
		float speeds[4];
		speeds[FRONT_LEFT]	= (float)usRegHoldingBuf[MB_OFFSET + MB_FRONT_LEFT];
		speeds[FRONT_RIGHT] = (float)usRegHoldingBuf[MB_OFFSET + MB_FRONT_RIGHT];
		speeds[REAR_LEFT]	= (float)usRegHoldingBuf[MB_OFFSET + MB_REAR_LEFT];
		speeds[REAR_RIGHT]	= (float)usRegHoldingBuf[MB_OFFSET + MB_REAR_RIGHT];
		SetMotors(speeds);	
	}
	else
	{
		usRegHoldingBuf[MB_OFFSET + MB_FRONT_LEFT] = counter[FRONT_LEFT];
		usRegHoldingBuf[MB_OFFSET + MB_FRONT_RIGHT] = counter[FRONT_RIGHT];
		usRegHoldingBuf[MB_OFFSET + MB_REAR_LEFT] = counter[REAR_LEFT];
		usRegHoldingBuf[MB_OFFSET + MB_REAR_RIGHT] = counter[REAR_RIGHT];
	}		
	
	//t_Ox.value = 0;
	//t_Oy.value = 0;
	t_Ox.array[0] = usRegHoldingBuf[2];
	t_Ox.array[1] = usRegHoldingBuf[3];
		
	t_Oy.array[0] = usRegHoldingBuf[4];
	t_Oy.array[1] = usRegHoldingBuf[5];
	
	t_Oz.array[0] = usRegHoldingBuf[6];
	t_Oz.array[1] = usRegHoldingBuf[7];
		
	ModbusEEPROMLoader();
}
开发者ID:KoteSoft,项目名称:Quadrocopter-flight-controller,代码行数:80,代码来源:Params.cpp

示例11: ui_stop_read

void ui_stop_read(void)
{
	LED_Off(LED1_GPIO);
}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:4,代码来源:ui.c

示例12: ui_init

void ui_init(void)
{
	LED_Off(LED0_GPIO);
	LED_Off(LED1_GPIO);
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:5,代码来源:ui.c

示例13: ui_process

void ui_process(uint16_t framenumber)
{
	bool b_btn_state, success;
	static bool btn_last_state = false;
	static bool sequence_running = false;
	static uint8_t sequence_pos = 0;
	uint8_t value;
	static uint16_t cpt_sof = 0;

	if ((framenumber % 1000) == 0) {
		LED_On(LED0);
	}
	if ((framenumber % 1000) == 500) {
		LED_Off(LED0);
	}
	/* Scan process running each 2ms */
	cpt_sof++;
	if ((cpt_sof % 2) == 0) {
		return;
	}

	/* Scan button on push button (SW0) to send keys sequence */
	b_btn_state = !ioport_get_pin_level(GPIO_PUSH_BUTTON_1);
	if (b_btn_state != btn_last_state) {
		btn_last_state = b_btn_state;
		if (btn_wakeup) {
			if (!b_btn_state) {
				btn_wakeup = false;
			}
		} else {
			sequence_running = true;
		}
	}

	/* Sequence process running each period */
	if (SEQUENCE_PERIOD > cpt_sof) {
		return;
	}
	cpt_sof = 0;

	if (sequence_running) {
		/* Send next key */
		value = ui_sequence[sequence_pos].value;
		if (value!=0) {
			if (ui_sequence[sequence_pos].b_modifier) {
				if (ui_sequence[sequence_pos].b_down) {
					success = udi_hid_kbd_modifier_down(value);
				} else {
					success = udi_hid_kbd_modifier_up(value);
				}
			} else {
				if (ui_sequence[sequence_pos].b_down) {
					success = udi_hid_kbd_down(value);
				} else {
					success = udi_hid_kbd_up(value);
				}
			}
			if (!success) {
				return; /* Retry it on next schedule */
			}
		}
		/* Valid sequence position */
		sequence_pos++;
		if (sequence_pos >=
			sizeof(ui_sequence) / sizeof(ui_sequence[0])) {
			sequence_pos = 0;
			sequence_running = false;
		}
	}
}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:70,代码来源:ui.c

示例14: main

/**
 * \brief Application entry point for TWI EEPROM example.
 *
 * \return Unused (ANSI-C compatibility).
 */
int main(void)
{
	uint32_t i;
	twihs_options_t opt;
	twihs_packet_t packet_tx, packet_rx;

	/* Initialize the SAM system */
	sysclk_init();

	/* Initialize the board */
	board_init();

	/* Turn off LEDs */
	LED_Off(LED0);
	
    /* Initialize the console UART */
	configure_console();

	/* Output example information */
	puts(STRING_HEADER);

	/* Configure systick for 1 ms */
	puts("Configure system tick to get 1ms tick period.\r");
	if (SysTick_Config(sysclk_get_cpu_hz() / 1000)) {
		puts("-E- Systick configuration error\r");
		while (1) {
			/* Capture error */
		}
	}

	/* Enable the peripheral clock for TWI */
	pmc_enable_periph_clk(BOARD_ID_TWIHS_EEPROM);

	/* Configure the options of TWI driver */
	opt.master_clk = sysclk_get_cpu_hz();
	opt.speed      = TWIHS_CLK;

	/* Configure the data packet to be transmitted */
	packet_tx.chip        = AT24C_ADDRESS;
	packet_tx.addr[0]     = EEPROM_MEM_ADDR >> 8;
	packet_tx.addr[1]     = EEPROM_MEM_ADDR;
	packet_tx.addr_length = EEPROM_MEM_ADDR_LENGTH;
	packet_tx.buffer      = (uint8_t *) test_data_tx;
	packet_tx.length      = TEST_DATA_LENGTH;

	/* Configure the data packet to be received */
	packet_rx.chip        = packet_tx.chip;
	packet_rx.addr[0]     = packet_tx.addr[0];
	packet_rx.addr[1]     = packet_tx.addr[1];
	packet_rx.addr_length = packet_tx.addr_length;
	packet_rx.buffer      = gs_uc_test_data_rx;
	packet_rx.length      = packet_tx.length;

	if (twihs_master_init(BOARD_BASE_TWIHS_EEPROM, &opt) != TWIHS_SUCCESS) {
		puts("-E-\tTWI master initialization failed.\r");
		while (1) {
			/* Capture error */
		}
	}

	/* Send test pattern to EEPROM */
	if (twihs_master_write(BOARD_BASE_TWIHS_EEPROM, &packet_tx) != TWIHS_SUCCESS) {
		puts("-E-\tTWI master write packet failed.\r");
		while (1) {
			/* Capture error */
		}
	}
	puts("Write:\tOK!\n\r");

	/* Wait at least 10 ms */
	mdelay(WAIT_TIME);

	/* Get memory from EEPROM*/
	if (twihs_master_read(BOARD_BASE_TWIHS_EEPROM, &packet_rx) != TWIHS_SUCCESS) {
		puts("-E-\tTWI master read packet failed.\r");
		while (1) {
			/* Capture error */
		}
	}
	puts("Read:\tOK!\r");

	/* Compare the sent and the received */
	for (i = 0; i < TEST_DATA_LENGTH; i++) {
		if (test_data_tx[i] != gs_uc_test_data_rx[i]) {
			/* No match */
			puts("Data comparison:\tUnmatched!\r");
			while (1) {
				/* Capture error */
			}
		}
	}
	/* Match */
	puts("Data comparison:\tMatched!\r");
	LED_On(LED0);
	while (1) {
//.........这里部分代码省略.........
开发者ID:thegeek82000,项目名称:asf,代码行数:101,代码来源:twihs_master_example.c

示例15: ui_com_rx_stop

void ui_com_rx_stop(void)
{
	LED_Off(LED3_GPIO);
}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:4,代码来源:ui.c


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