Beispiel #1
0
void light_led_continuously( int sig)
{
	light_off();
	count += time;
	
	return;
}
void on_off()
{
	light_on();
	for (int i = 0; i < 250000; ++i)
	{
	}
	light_off();
	for (int i = 0; i < 250000; ++i)
	{
	}
}
Beispiel #3
0
void on_ready( )
{
  ble_device_set_name("RGB_Light"); 
	ble_device_set_advertising_interval(2000);
  ble_device_start_advertising();
	
  //uint8_t rgb_pin[4] = {7, 6, 5};
  //uint8_t rgb_pin[4] = {23, 21, 22};
  uint8_t rgb_pin[4] = {12, 11, 29};
  light_setup(rgb_pin, 1);
  
  light_off();
}
Beispiel #4
0
void ble_device_on_message(uint8_t type, uint16_t length, uint8_t* value)
{
  uint8_t onoff = value[0];
  uint8_t * rgb = value+1;                                     
  
  if(onoff == 1)
  {
    light_off();
    light_set_color(rgb);
    light_on();

  }
  else if(onoff == 0)
  {
    light_off();
  }
  else if(onoff == 2)
  {
    light_off();
    light_set_color(rgb_color);
    light_on();
  }
}
void pge_deinit() {
    // Finish the game
    race_result_destroy_assets();
    race_result_destroy_title_fonts();
    race_result_destroy_animations();
    race_delete_cars();
    destroy_kerb_bitmaps();
    destroy_finish_line_bitmap();
    app_timer_cancel(fpsTimer);
    light_off(NULL);
    main_menu_destroy();
    destroy_splashscreen();
    pge_finish();
}
Beispiel #6
0
void light_led_blinking( int sig )
{
	unsigned int tmp;
	
	read_reg( (gpioaddr + 0x00), tmp );
	if (tmp & 0x00000080) {
		light_off();	
    	count++;
	}
	else {
		light_on();
	}


	return;
}
Beispiel #7
0
QState s_light_off(ao_light_t * const me)
{
    QState status;
    switch (Q_SIG(me)) {
        case Q_ENTRY_SIG:
            light_off();
            status = Q_HANDLED();
            break;
        case LIGHT_TIMER_SIG:
            me->timer = (uint32_t)Q_PAR(me);
            status = Q_TRAN(&s_light_timer);
            break;
        case LIGHT_ON_SIG:
            status = Q_TRAN(&s_light_on);
            break;
        default:
            status = Q_SUPER(&QHsm_top);
            break;
    }
    return status;
}
Beispiel #8
0
void light_timer() {
    // switch off the light pulse
    light_off();
}