Beispiel #1
0
void goodbye_alert(bool audible) {
  if (!audible)
    return;
  nx_sound_freq(2000, 100);
  nx_systick_wait_ms(50);
  nx_sound_freq(1000, 100);
  nx_systick_wait_ms(900);
}
Beispiel #2
0
void goodbye(void) {
  if (test_silent)
    return;
  nx_sound_freq(2000, 100);
  nx_systick_wait_ms(50);
  nx_sound_freq(1000, 100);
  nx_systick_wait_ms(900);
}
Beispiel #3
0
void main(void)
{

	init();
		nx_systick_wait_ms(5000);
/*
vDisplaySensorsValues();
U32 pos1=0;
	U32 pos2=0;
	vForwardStop(&pos1,&pos2,500);
		nx_systick_wait_ms(1000);
	vTurnRight(&pos1,&pos2);
		nx_systick_wait_ms(1000);
	vForwardStop(&pos1,&pos2,250);
		nx_systick_wait_ms(1000);
	vTurnLeft(&pos1,&pos2);
		nx_systick_wait_ms(1000);
	vForwardStop(&pos1,&pos2,250);
		nx_systick_wait_ms(1000);
	vTurnRight(&pos1,&pos2);
		nx_systick_wait_ms(1000);
	vForwardStop(&pos1,&pos2,250);
		nx_systick_wait_ms(1000);
	vTurnRight(&pos1,&pos2);
		nx_systick_wait_ms(1000);
	vForwardStop(&pos1,&pos2,500);
		nx_systick_wait_ms(1000);
	vTurnRight(&pos1,&pos2);
		nx_systick_wait_ms(1000);
	vForwardStop(&pos1,&pos2,250);
		nx_systick_wait_ms(1000);
	vTurnLeft(&pos1,&pos2);
		nx_systick_wait_ms(1000);
	vForwardStop(&pos1,&pos2,250);
*/
	nx_display_cursor_set_pos(0, 5);
	nx_display_string("en attente");

	while (!quit) {
		if (!nx_bt_stream_opened() || nx_bt_connection_pending())
			bt_wait_connection();
		else
		{
			nx_sound_freq(DO, 200);
			nx_sound_freq(DO, 200);
			nx_sound_freq(DO, 200);
			handle_cmd();

		}
	}


	die();
}
Beispiel #4
0
void tests_sound(void) {
  enum {
    end = 0, sleep500 = 1, si = 990, dod = 1122,
    re = 1188, mi = 1320, fad = 1496, sol = 1584,
  } pain[] = {
    si, sleep500,
    fad, si, sol, sleep500,
    fad, mi, fad, sleep500,
    mi, fad, sol, sol, fad, mi, si, sleep500,
    fad, si, sol, sleep500,
    fad, mi, re,  sleep500,
    mi, re,  dod, dod, re,  dod, si, end
  };
  int i = 0;

  hello();

  nx_display_clear();
  nx_display_cursor_set_pos(0,0);
  nx_display_string("-- Sound test --\n"
		    "----------------\n");

  while (pain[i] != end) {
    if (pain[i] == sleep500)
      nx_systick_wait_ms(150);
    else
      nx_sound_freq(pain[i], 150);
    nx_systick_wait_ms(150);
    i++;
  }

  nx_systick_wait_ms(1000);
  goodbye();
}
Beispiel #5
0
static void beep_consumer(void) {
  while(1) {
    mv_semaphore_dec(beep_res);
    nx_sound_freq(820, 500);
  }
}
Beispiel #6
0
void vPlaySond() {
	//Play sound
	nx_sound_freq(DO, 200);
	nx_sound_freq(DO, 200);
	nx_sound_freq(DO, 200);
	nx_sound_freq(RE, 200);
	nx_sound_freq(MI, 200);
	nx_sound_freq(RE, 200);
	nx_sound_freq(DO, 200);
	nx_sound_freq(MI, 200);
	nx_sound_freq(RE, 200);
	nx_sound_freq(RE, 200);
	nx_sound_freq(DO, 200);
}