Пример #1
0
void pinpon (void)
{
	int status = rflpc_eth_link_state () ;

	if (status)
	{	

		while(rflpc_eth_link_state ()){
		rflpc_led_set(RFLPC_LED_1);
		rflpc_led_set(RFLPC_LED_2);
		wait(1);
		rflpc_led_set(RFLPC_LED_3);
		rflpc_led_set(RFLPC_LED_4);
		rflpc_led_clr(RFLPC_LED_1);
		rflpc_led_clr(RFLPC_LED_2);
		wait(1);
		rflpc_led_clr(RFLPC_LED_3);
		rflpc_led_clr(RFLPC_LED_4);
		}

	}
	else
	{
		rflpc_led_clr(RFLPC_LED_1);
		rflpc_led_clr(RFLPC_LED_2);
		rflpc_led_clr(RFLPC_LED_3);
		rflpc_led_clr(RFLPC_LED_4);

	}

}
Пример #2
0
/* simple contents generator */
static char doGet(struct args_t *args) {
    
	rflpc_gpio_set_pin_mode_output(MBED_DIP23, 1);
	rflpc_gpio_set_pin_mode_output(MBED_DIP24, 1);
	rflpc_gpio_set_pin_mode_output(MBED_DIP25, 1);
	
    switch(args->color){
		case 0:
			rflpc_gpio_set_pin(MBED_DIP23);
			rflpc_gpio_set_pin(MBED_DIP24);
			rflpc_gpio_set_pin(MBED_DIP25);
			rflpc_led_set(RFLPC_LED_1);
			break;
		case 1:
			rflpc_gpio_clr_pin(MBED_DIP23);
			break;
		case 2:
			rflpc_gpio_clr_pin(MBED_DIP24);;
			break;
		case 3:
			rflpc_gpio_clr_pin(MBED_DIP25);
			rflpc_led_set(RFLPC_LED_4);
			break;
	}

    return 1;
}
Пример #3
0
int main()
{
    int j,i = 0;
    rflpc_led_init();
    
    rflpc_led_set(RFLPC_LED_1);
    for (j = 0 ; j < 10000000 ; ++j);
    rflpc_led_set(RFLPC_LED_2);
    for (j = 0 ; j < 10000000 ; ++j);
    rflpc_led_set(RFLPC_LED_3);
    for (j = 0 ; j < 10000000 ; ++j);
    rflpc_led_set(RFLPC_LED_4);

    for (j = 0 ; j < 10000000 ; ++j);
    rflpc_led_clr(RFLPC_LED_1);
    for (j = 0 ; j < 10000000 ; ++j);
    rflpc_led_clr(RFLPC_LED_2);
    for (j = 0 ; j < 10000000 ; ++j);
    rflpc_led_clr(RFLPC_LED_3);
    for (j = 0 ; j < 10000000 ; ++j);
    rflpc_led_clr(RFLPC_LED_4);


    while (1)
    {
	rflpc_led_binary_value((i++)%16);
	for (j = 0 ; j < 1000000 ; ++j);
    }
    return 0;
}
Пример #4
0
static void timer() {
	if(rflpc_gpio_get_pin(MBED_DIP12)){
		joystick = 2;
	}
	else if(rflpc_gpio_get_pin(MBED_DIP13)){
		joystick = 4;
	}
	else if(rflpc_gpio_get_pin(MBED_DIP14)){
		joystick = 5;
	}
	else if(rflpc_gpio_get_pin(MBED_DIP15)){
		joystick = 8;
	}
	else if(rflpc_gpio_get_pin(MBED_DIP16)){
		joystick = 6;
	}
	else{
		joystick = 0;
	}
	if(joystick != oldjoystick){
		glob_load = (uint16_t)joystick;
		rflpc_led_set(RFLPC_LED_1);
		server_push(&joystickChannel);
	}
}
Пример #5
0
/* simple contents generator */
static char doGet(struct args_t *args) {
    
    rflpc_led_init();
    
    if(args->led == 1){
		rflpc_led_set(RFLPC_LED_1);
	}
	if(args->led == 2){
		rflpc_led_set(RFLPC_LED_2);
	}
	if(args->led == 3){
		rflpc_led_set(RFLPC_LED_3);
	}
	if(args->led == 4){
		rflpc_led_set(RFLPC_LED_4);
	}

    return 1;
}
void enableled(){
  if(rflpc_eth_link_state()){
    rflpc_led_set(RFLPC_LED_1);
  }
  else
    {
      rflpc_led_clr(RFLPC_LED_1);
    }
  

}
Пример #7
0
int main()
{
  rflpc_eth_init();
  rflpc_led_init();
  while(1){
    if(rflpc_eth_link_state()){
      rflpc_led_set(RFLPC_LED_1);
    }
    else{
      rflpc_led_clr(RFLPC_LED_1);
    }
  }
  return 0;
}
Пример #8
0
static char do_led(struct args_t *args) {
	
	rflpc_led_init();
	
	if(args) {
		int rep = (int) args->on;
		
		if(rep) {
			rflpc_led_set(RFLPC_LED_1);
		} else {
			rflpc_led_clr(RFLPC_LED_1);
		}
	}
	
 	return 1;
}