void mode_hourlychime2_alarm(bool longAlarm) {
  // Short alarm first, always
  pulse_vibe_on();
  pulse_mdelay(200);
  pulse_vibe_off();

  // Long alarm if we need one
  if (longAlarm) {
    pulse_mdelay(250); // pause
    pulse_vibe_on();
    pulse_mdelay(200); // longer...
    pulse_vibe_off();
  }
}
Beispiel #2
0
void mode_demo_init() {
  multi_debug("init\n");
  multiMyWatchFaceName = "mode_demo";
  multiLoopTimeMS = 1000; // 1 second, since 200ms is too spammy in the demo
  multiButtonDownLongPressTimeMS = 400; // just under half a second
  printf("MODEINIT\nThe display is not really available...\n");
  // Would normally not pause here!
  pulse_mdelay(2000);
}
Beispiel #3
0
void
main_app_handle_doz(void)
{
	// Fade out
	for (int i = 100; i >= 0; i -= 6)
	{
		pulse_oled_set_brightness(i);
		pulse_mdelay(60);
	}
}
Beispiel #4
0
void game_over() {
    pulse_vibe_on();
    pulse_mdelay(60);
    pulse_vibe_off();
    //int vib_timer = pulse_register_timer(75, &pulse_vibe_off, 0);

    current_screen = SCREEN_GAME_OVER;
    pulse_blank_canvas();
    if (score > highscore)
        highscore = score;
    printf ("GAME OVER\n\nScore: %d\n\nHighscore: %d\n\nClick to restart",score,highscore);
    reset_game();
    prepare_to_sleep();
}
// Special loop that runs even if the watch is not on
// We can't rely on pulse_register_timer etc since they aren't running if
// the screen isn't on.
// pulse_get_millis doesn't update, and the clock runs so slow that per min is
// about as good as it gets.
// Screen cannot be used.
void mode_btlostphone_apploop(void) {
  multi_debug("mode_btlostphone_apploop\n");
  // multi_debug("%i > %i\n", pulse_get_millis(), mode_btlostphone_millis);
  // ALARM if we have passed our timeout
  if (multiTimeNow.tm_min != mode_btlostphone_min) {
    multi_debug("vibe!\n");

    // schedule next "alarm"
    mode_btlostphone_min = multiTimeNow.tm_min;

    // Buzz
    pulse_vibe_on();
    pulse_mdelay(1000); // should notice this...
    pulse_vibe_off();
  }
}
Beispiel #6
0
void mode_demo_cold_boot() {
  multi_debug("cold boot\n");
  printf("COLDBOOT\nThe display is not really available...\n");
  pulse_mdelay(1000);
}