您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vibes_short_pulse函数代码示例

51自学网 2021-06-03 09:39:34
  C++
这篇教程C++ vibes_short_pulse函数代码示例写得很实用,希望能帮到您。

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

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

示例1: in_received_handler

void in_received_handler(DictionaryIterator *iter, void *context) {#ifdef ENABLE_LOGS    APP_LOG(APP_LOG_LEVEL_DEBUG, "Watch: Message received");#endif        int x = 0;        //processing usernames    for (x=0;x<MAX_NUM_USERS;x++){        Tuple *tuple = dict_find(iter, CONST_FRIEND1+x);        if (tuple){            set_username_for_friend_at_index(tuple->value->cstring,x);        }    }    //processing ids    for (x=0;x<MAX_NUM_USERS;x++){        Tuple *tuple = dict_find(iter, CONST_FRIEND1+x+100);        if (tuple){            set_id_for_friend_at_index(tuple->value->cstring,x);        }    }        //processing number of friends received, this message should be the last one done in JS    Tuple *tuple = dict_find(iter, CONST_FRIENDS_COUNT);    if (tuple){        set_num_friends(tuple->value->int32);        save_cache();    }        //Confirmation of Sending Message    Tuple *tuple2 = dict_find(iter, CONST_STATUS);    if (tuple2){        int error = tuple2->value->int32;        if (error == STYLE_ERROR) {            vibes_long_pulse();            show_message_window(_("Message|Failed"),STYLE_ERROR);        }        else {            vibes_short_pulse();            show_message_window(_("Message|Sent"),STYLE_SUCCESS);        }    }        //Confirmation of Sending Message    Tuple *tuple3 = dict_find(iter, CONST_ERROR_UPDATING_TOKEN);    if (tuple3){        int error = tuple3->value->int32;        if (error == STYLE_ERROR) {            vibes_long_pulse();            show_message_window(_("Failed|to Sync"),STYLE_ERROR);        }        else {            vibes_short_pulse();            show_message_window(_("Sync|Succeed"),STYLE_SUCCESS);        }    }}
开发者ID:calitb,项目名称:Voice-Chat,代码行数:57,


示例2: handle_vibe

static void handle_vibe(DictionaryIterator *iter, SimplyData *simply) {  Tuple *tuple;  if ((tuple = dict_find(iter, 1))) {    switch ((VibeType) tuple->value->int32) {      case VibeShort: vibes_short_pulse(); break;      case VibeLong: vibes_short_pulse(); break;      case VibeDouble: vibes_double_pulse(); break;    }  }}
开发者ID:ericmigi,项目名称:simplyjs-1,代码行数:10,


示例3: vibrate_quarterly_pattern

static void vibrate_quarterly_pattern(int minutes) {  if(minutes % 15 == 0) {    vibes_short_pulse();  }    if(minutes % 30 == 0) {    vibes_short_pulse();  }    if(minutes % 45 == 0) {    vibes_short_pulse();  }}
开发者ID:chrisruffalo,项目名称:pebble-el-cid,代码行数:13,


示例4: menu_select_callback

void menu_select_callback(MenuLayer *menu_layer, MenuIndex *cell_index, void *data) {  switch (cell_index->section) {    case 0:      switch (cell_index->row) {      case 0:        if (loading==0) carga_calendario();        break;      case 1:        if (loading==0) carga_fpp();        break;      }      break;        case 1:      switch (cell_index->row) {      case 0:         if (loading==0){           send_int(5,5);           char version[20];           time_t now = time(NULL);           struct tm *tick_time = localtime(&now);            snprintf(version, 20, "Versión: %i-%i-%i",tick_time->tm_mday,(tick_time->tm_mon)+1,(tick_time->tm_year)-100);            vibes_short_pulse();           loading = 0;           layer_mark_dirty(menu_layer_get_layer(menu_layer));         }         break;      }      break;      }}
开发者ID:pjexposito,项目名称:HorarioMiguel,代码行数:31,


示例5: update_hours

static void update_hours(struct tm *tick_time) {  if(appStarted && hourlyvibe) {    //vibe!    vibes_short_pulse();  }    unsigned short display_hour = get_display_hour(tick_time->tm_hour);  set_container_image(&time_digits_images[0], time_digits_layers[0], BIG_DIGIT_IMAGE_RESOURCE_IDS[display_hour/10], GPoint(0, 14)); //n3v3r original 5-> je zahl nun 4 breiter  set_container_image(&time_digits_images[1], time_digits_layers[1], BIG_DIGIT_IMAGE_RESOURCE_IDS[display_hour%10], GPoint(32, 14)); //n3v3r original 33  if (!clock_is_24h_style()) {    if (tick_time->tm_hour >= 12) {      set_container_image(&time_format_image, time_format_layer, RESOURCE_ID_IMAGE_PM_MODE, GPoint(60, 2));      layer_set_hidden(bitmap_layer_get_layer(time_format_layer), false);    }     else {      layer_set_hidden(bitmap_layer_get_layer(time_format_layer), true);    }        if (display_hour/10 == 0) {      layer_set_hidden(bitmap_layer_get_layer(time_digits_layers[0]), true);    }    else {      layer_set_hidden(bitmap_layer_get_layer(time_digits_layers[0]), false);    }  }}
开发者ID:n3v3r001,项目名称:n3v3rsbigone,代码行数:30,


示例6: endtrial_callback

static void endtrial_callback() {  pause++;  vibes_short_pulse();  end_time = time(NULL);  double elapsed = difftime(end_time, start_time);  result = (int)floor(sum_x/elapsed);    display(text_layer_3, "Final: %d", result);    action_bar_layer_set_icon(s_action_bar, BUTTON_ID_SELECT, s_icon_play);  int calib_stored = persist_exists(CALIB_PKEY) ? persist_read_int(CALIB_PKEY) : CALIB_DEFAULT;  if (result > 2*calib_stored) {    send(0,1);    text_layer_set_text(text_layer_1, "YOU'RE DRUNK");    text_layer_set_text(text_layer_4, "");    dialog_message_window_push();  }  else {    send(0,0);    text_layer_set_text(text_layer_1, "YOU'RE FINE");    text_layer_set_text(text_layer_2, "");    text_layer_set_text(text_layer_4, "");  }}
开发者ID:mohaiminalaoun,项目名称:Drunkness-tester,代码行数:26,


示例7: up_down_handler

/* * Handle an up or down button press and validate results */static void up_down_handler(int8_t delta) {  switch (current_field) {    case F_FROM_HOUR:    case F_TO_HOUR:      alter_time(current_field, delta, 23, 0);      break;    case F_FROM_MINUTE:    case F_TO_MINUTE:      alter_time(current_field, 5 * delta, 55, 0);      break;    case F_SMART_ALARM:      alter_time(current_field, 1, 1, 0);      break;    case F_DONE:      if (values[F_DONE] == 1)        hide_set_alarm();      else        vibes_short_pulse();      break;  }  uint32_t from = to_mins(values[F_FROM_HOUR], values[F_FROM_MINUTE]);  uint32_t to = to_mins(values[F_TO_HOUR], values[F_TO_MINUTE]);  values[F_DONE] = (from <= to);  write_values_to_fields();}
开发者ID:hashier,项目名称:morpheuz20,代码行数:28,


示例8: inbox

void inbox(DictionaryIterator *iter, void *context){  Tuple *t = dict_read_first(iter);  if(t) process_tuple(t);  while(t != NULL){	t = dict_read_next(iter);	if(t) process_tuple(t);  }	  if(current == INIT){	  current = SPLASH;  }  else if(current == SPLASH){	current = HOME;	window_stack_push(home_window, true);	window_stack_remove(splash_window, false);  }  else if(current == LOADING){	push_appropriate_window();  }  else if(current == MATCHUP){	//APP_LOG(APP_LOG_LEVEL_INFO, "Old Ally: %d, Old Enemy: %d. Ally: %d, Enemy: %d.", old_matchup_ally_score_int,old_matchup_enemy_score_int,matchup_ally_score_int,matchup_enemy_score_int);	if( (old_matchup_ally_score_int > old_matchup_enemy_score_int && matchup_ally_score_int < matchup_enemy_score_int)	 || (old_matchup_ally_score_int < old_matchup_enemy_score_int && matchup_ally_score_int > matchup_enemy_score_int)	 || (old_matchup_ally_score_int == 0 && old_matchup_enemy_score_int == 0 && (matchup_ally_score_int != 0 || matchup_enemy_score_int != 0)))	{		vibes_short_pulse();	}	old_matchup_ally_score_int = matchup_ally_score_int;	old_matchup_enemy_score_int = matchup_enemy_score_int;	   	  	layer_mark_dirty(matchup_custom_layer);  }}
开发者ID:MathewReiss,项目名称:Yahoo2015,代码行数:33,


示例9: timer_callback

static void timer_callback(struct tm *tick_time, TimeUnits units_changed) {	if (state.round_time == 0) {		if (state.stretch && stretch_settings.prepare != 0) {			state.round++;			state.round_time = stretch_settings.prepare;      			vibes_long_pulse();			text_layer_set_text(ui.top_text, "Prepare");			state.stretch = 0;		} else {			if (stretch_settings.prepare == 0) {				state.round++;			}			state.round_time = stretch_settings.time;			vibes_short_pulse();			text_layer_set_text(ui.top_text, "Stretch");			state.stretch = 1;		}		update_ui();	}	if (state.running) {		update_time_ui();	}}
开发者ID:gotling,项目名称:GoSy-Run,代码行数:26,


示例10: ComputeRandomEvent

bool ComputeRandomEvent(bool fastMode){	uint16_t chanceOfEvent = EVENT_CHANCE_BASE;#if EVENT_CHANCE_SCALING	if(ticksSinceLastEvent > 3) {		chanceOfEvent += (ticksSinceLastEvent - 2) * 4;	}#endif	if(!fastMode) {		uint16_t result = Random(100) + 1;		if(result > chanceOfEvent) {			if(Random(4) == 1) {				HealStamina(1);			}			return false;		}	}		if(GetVibration())		vibes_short_pulse();			ComputeAdventure();	#if EVENT_CHANCE_SCALING		ticksSinceLastEvent = 0;#endif	return true;}
开发者ID:Belphemur,项目名称:MiniDungeon,代码行数:28,


示例11: update_hours

static void update_hours(struct tm *tick_time) {	if (appStarted && hourlyvibe) {    //vibe!    vibes_short_pulse();	}	  unsigned short display_hour = get_display_hour(tick_time->tm_hour);  set_container_image(&normal_time_digits_images[0], normal_time_digits_layers[0], NORMAL_IMAGE_RESOURCE_IDS[display_hour/10], GPoint(0, 40));  set_container_image(&normal_time_digits_images[1], normal_time_digits_layers[1], NORMAL_IMAGE_RESOURCE_IDS[display_hour%10], GPoint(34, 40));		if (!clock_is_24h_style()) {		if (display_hour/10 == 0) {				 	layer_set_hidden(bitmap_layer_get_layer(normal_time_digits_layers[0]), true); 		  } else  if (flip == 0) {		    layer_set_hidden(bitmap_layer_get_layer(normal_time_digits_layers[0]), false);            	}	}							 static char ampm_text[] = "am";		     if (!clock_is_24h_style()) {		strftime(ampm_text, sizeof(ampm_text), "%P", tick_time);        text_layer_set_text(layer_ampm_text, ampm_text);			 }}
开发者ID:mereed,项目名称:pebbleface-tiktocdigital,代码行数:31,


示例12: toggle_bluetooth_icon

static void toggle_bluetooth_icon(bool connected) {  if(appStarted && !connected && bluetoothvibe) {    //vibe!    vibes_short_pulse();  }  layer_set_hidden(bitmap_layer_get_layer(bluetooth_layer), connected);}
开发者ID:mereed,项目名称:pebbleface-tiktocdigital,代码行数:7,


示例13: handle_tick

static void handle_tick(struct tm *t, TimeUnits units_changed) {  if (strcmp(configs.secondhandoption, "stop2go") == 0) {    for (int i=0; i<STOP2GO_TICK_RESOLUTION; i++) {  		app_timer_register(1000 / STOP2GO_TICK_RESOLUTION * i, (void*)layer_mark_dirty, window_get_root_layer(s_window));    }  }  else {    layer_mark_dirty(window_get_root_layer(s_window));  }        // Hourly vibration  if (t->tm_min == 0 && t->tm_sec == 0) {    if (strcmp(configs.hourlyvibration, "short") == 0) {      vibes_short_pulse();    }    else if (strcmp(configs.hourlyvibration, "long") == 0) {      vibes_long_pulse();    }    else if (strcmp(configs.hourlyvibration, "double") == 0) {      vibes_double_pulse();    }  }}
开发者ID:joliva,项目名称:MondainePebbleWatchFace,代码行数:25,


示例14: tick

static void tick(struct tm *tick_time, TimeUnits units_changed){    if (s_second_rate < 2)    {        layer_mark_dirty(s_date_layer);        layer_mark_dirty(s_time_layer);    }    if (tick_time->tm_min == 0 && tick_time->tm_sec == 0 && s_vibe_hourly != SETTING_VIBE_DISABLED)    {        switch (s_vibe_hourly)        {        case SETTING_VIBE_LONG:            vibes_long_pulse();            break;        case SETTING_VIBE_SHORT:            vibes_short_pulse();            break;        case SETTING_VIBE_DOUBLE:            vibes_double_pulse();            break;        }    }    // Get weather update every 2 hours    if (s_weather_icon == -1 || s_weather_temp == -100 || tick_time->tm_mday*100+tick_time->tm_hour > s_last_update_time + 1)    {        request_weather();    }    if(tick_time->tm_hour % 2 == 0 && tick_time->tm_min == 0 && tick_time->tm_sec == 0)    {        request_weather();    }}
开发者ID:TsFreddie,项目名称:gear-pebble,代码行数:34,


示例15: bluetoothHandler

void bluetoothHandler(bool connected) {  APP_LOG(DebugLevel, "bluetoothHandler: start connected :%s:",connected ? "true" : "false");  bool prevConnected=false;  if(persist_exists(BT_STATUS)){    prevConnected = persist_read_bool(BT_STATUS);	APP_LOG(DebugLevel, "bluetoothHandler: initial key");  }	APP_LOG(DebugLevel, "bluetoothHandler: prevConnected :%s:",prevConnected ? "true" : "false");  if(connected && prevConnected) {     bitmap_layer_set_bitmap(GET_LAYER(BLUETOOTH_LAYER), bluetoothImageOn);	  APP_LOG(DebugLevel, "bluetoothHandler: both true turned on connection");  }  if(!connected && !prevConnected) {     bitmap_layer_set_bitmap(GET_LAYER(BLUETOOTH_LAYER), bluetoothImageOff);	  APP_LOG(DebugLevel, "bluetoothHandler: both false turned off connection");  }  if(connected && !prevConnected) {     bitmap_layer_set_bitmap(GET_LAYER(BLUETOOTH_LAYER), bluetoothImageOn);	  APP_LOG(DebugLevel, "bluetoothHandler: turned on connection");     vibes_short_pulse();  }  if(!connected && prevConnected) {  	  bitmap_layer_set_bitmap(GET_LAYER(BLUETOOTH_LAYER), bluetoothImageOff);	  APP_LOG(DebugLevel, "bluetoothHandler: turned off connection");     vibes_long_pulse();     btBuzzerTimer = app_timer_register(BUZZER_INTERVAL, buzzer2,NULL);  }  persist_write_bool(BT_STATUS, connected);  APP_LOG(DebugLevel, "bluetoothHandler: done saved :%s:",connected ? "true" : "false");} // bluetoothHandler
开发者ID:kentarchie,项目名称:pebble-IceWatchJS,代码行数:34,


示例16: vibrate_quarterly

void vibrate_quarterly() {  // load settings  ElCidSettings *settings = settings_load();      // don't vibrate if not set  if(!settings->QuarterHourlyVibrate) {    return;  }      // get hour from local time    time_t temp = time(NULL);  struct tm *tick_time = localtime(&temp);    // create pattern for vibration  int minutes = tick_time->tm_min;    // abort if not on the quarter hour  if(minutes == 0 || minutes % 15 != 0) {    return;  }    // get settings value after we know we need it  u_short vibration_type = settings->QuarterHourVibrationType;      // do pattern as configured  if(1 == vibration_type) {    vibes_short_pulse();  } else if(2 == vibration_type) {    vibes_long_pulse();  } else if(3 == vibration_type) {    vibes_double_pulse();  } else if(4 == vibration_type) {    vibrate_quarterly_pattern(minutes);  }}
开发者ID:chrisruffalo,项目名称:pebble-el-cid,代码行数:35,


示例17: handle_timer

void handle_timer(AppContextRef ctx, AppTimerHandle handle, uint32_t cookie) {  (void)handle;  if(cookie == TIMER_UPDATE) {    if(started) {      remaining_time -= 1;      if (remaining_time == 0){        if (working_mode){          vibes_short_pulse();        }        else{          vibes_double_pulse();        }        start_timer(SHORT_TIMER_DELAY);      }else{        if (remaining_time < 0){          if (working_mode){            reset_relax_count_down();          }          else{            reset_work_count_down();          }        }else{          display_time();        }        start_timer(TIMER_DELAY);      }    }  }}
开发者ID:juliengrenier,项目名称:pebble-pomodoro,代码行数:29,


示例18: check_vibration

void check_vibration(char *mode) {	if (strcmp(mode, MODE_LONG) == 0) {		vibes_long_pulse();	} else if (strcmp(mode, MODE_SHORT) == 0) {		vibes_short_pulse();	}}
开发者ID:xaman,项目名称:StatsForPebble,代码行数:7,


示例19: calibrate_accel_end

void calibrate_accel_end( bool keepData) {    int tries = 0;    vibes_short_pulse();    accel_data_service_unsubscribe();    if (keepData) {          thresholdUp -= (thresholdUp>>2);          // threshold set to 75% of max value: x - x/4, down = x'/2          while ((periodsSki != 3) && (tries < MAXCALIBTRY)) {               tries++;	 // threshold set to 75% of max value: x - x/4, down = x'/2         //    thresholdDown = thresholdUp>>1;	       periodsLift = calibrationCount;	       periodsSki = strokesDetected( calibrationSamples, calibrationCount);                   periodsStatic = thresholdUp;               lastAccel.timestamp = 0;               app_log(APP_LOG_LEVEL_INFO, __FILE__ , __LINE__, "Calib detected: %i", (int)periodsSki);               if (periodsSki > 3) thresholdUp += thresholdUp>>3;               if (periodsSki < 3) thresholdUp -= thresholdUp>>3;           }       if (periodsSki != 3) {           thresholdUp = MOVINGTHRESHOLD;           thresholdDown = STATICTHRESHOLD;       }       persist_write_int(THUPKEY, thresholdUp);       persist_write_int(THDOWNKEY, thresholdUp>>1);    }    else 
开发者ID:Serjar,项目名称:SkiMeter,代码行数:29,


示例20: pin_set_handler

static void pin_set_handler(ClickRecognizerRef recognizer, void *context) {  APP_LOG(APP_LOG_LEVEL_DEBUG, "Pin set");  if (hint_layer) {    text_layer_destroy(hint_layer);    hint_layer = NULL;  }   else {    app_timer_reschedule(locationtimer, 1000 * (nextcall + 10));    strcpy(command, "pin");    DictionaryIterator *iter;    app_message_outbox_begin(&iter);    if (iter == NULL) {      vibes_short_pulse();      APP_LOG(APP_LOG_LEVEL_WARNING, "Can not send command %s to phone!", command);      return;    }    dict_write_cstring(iter, CMD_KEY, command);    const uint32_t final_size = dict_write_end(iter);    app_message_outbox_send();    APP_LOG(APP_LOG_LEVEL_DEBUG, "Sent command '%s' to phone! (%d bytes)", command, (int) final_size);    if (!hint_layer) {      Layer *window_layer = window_get_root_layer(window);      hint_layer = text_layer_create(hint_layer_size);      text_layer_set_font(hint_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));      text_layer_set_text_alignment(hint_layer, GTextAlignmentCenter);      layer_add_child(window_layer, text_layer_get_layer(hint_layer));    }    text_layer_set_text(hint_layer, "/nSetting/ntimeline/npin...");  }}
开发者ID:edmund-k,项目名称:pebble-geocachingpro-back,代码行数:30,


示例21: main_window_set_status

void main_window_set_status( bool connected ){    if ( LOCAL_last_status == connected )    return;    if ( LOCAL_last_status >= 0 )    vibes_short_pulse();    LOCAL_last_status = connected;    GColor front = GColorWhite;  GColor back  = GColorBlack;    if ( connected == true )  {     back  = GColorWhite;     front = GColorBlack;  }    for ( int loop = 0; loop < 4; loop ++ )  {    text_layer_set_background_color( LOCAL_layers[loop], back );    text_layer_set_text_color( LOCAL_layers[loop] , front );  }  }
开发者ID:LucaBongiorni,项目名称:pebble-linux-remote,代码行数:26,


示例22: select_click_callback

static void select_click_callback(MenuLayer *menu_layer, MenuIndex *cell_index, void *callback_context) {  APP_LOG(APP_LOG_LEVEL_DEBUG, "Got a click for row %d", cell_index->row);  if (hint_layer) {    text_layer_destroy(hint_layer);    hint_layer = NULL;  }  if (cell_index->row > 0) {    app_timer_reschedule(locationtimer, 1000 * (nextcall + 10));    if (cell_index->row == 1) {      strcpy(command, "set");    text_layer_set_text(distance_layer, "0");    } else      snprintf(command, sizeof(command), "set%d", (cell_index->row)-2);    DictionaryIterator *iter;    app_message_outbox_begin(&iter);    if (iter == NULL) {      vibes_short_pulse();      APP_LOG(APP_LOG_LEVEL_WARNING, "Can not send command %s to phone!", command);      return;    }    dict_write_cstring(iter, CMD_KEY, command);    const uint32_t final_size = dict_write_end(iter);    app_message_outbox_send();    APP_LOG(APP_LOG_LEVEL_DEBUG, "Sent command '%s' to phone! (%d bytes)", command, (int) final_size);  }  window_stack_pop(animated);}
开发者ID:edmund-k,项目名称:pebble-geocachingpro-back,代码行数:27,


示例23: inbox_received_handler

static void inbox_received_handler(DictionaryIterator *iter, void *context) {    Tuple *show_seconds_hand_t = dict_find(iter, KEY_SHOW_SECONDS_HAND);  Tuple *connection_lost_vibe_t = dict_find(iter, KEY_CONNECTION_LOST_VIBE);  Tuple *color_reverse_t = dict_find(iter, KEY_COLOR_REVERSE);    if (show_seconds_hand_t) {    s_show_seconds_hand = show_seconds_hand_t->value->int8;    persist_write_bool(KEY_SHOW_SECONDS_HAND, s_show_seconds_hand);    APP_LOG(APP_LOG_LEVEL_DEBUG, "s_show_seconds_hand %d", s_show_seconds_hand);    //vibes_short_pulse();  }     if (connection_lost_vibe_t) {    s_connection_lost_vibe = connection_lost_vibe_t->value->int8;    persist_write_bool(KEY_CONNECTION_LOST_VIBE, s_connection_lost_vibe);    APP_LOG(APP_LOG_LEVEL_DEBUG, "s_connection_lost_vibe %d", s_connection_lost_vibe);    vibes_short_pulse();  }   if (color_reverse_t) {    s_color_reverse = color_reverse_t->value->int8;    persist_write_bool(KEY_COLOR_REVERSE, s_color_reverse);    APP_LOG(APP_LOG_LEVEL_DEBUG, "s_color_reverse %d", s_color_reverse);    set_color_data();    set_layer_color();  } }
开发者ID:bake-san,项目名称:ANALOG-P-SHOCK,代码行数:32,


示例24: counter_timeout

static void counter_timeout(void){    //Create variable to store count, down from 3    static int8_t count = 3;    static char count_str[] = " ";    count--;    if (0 == count)    {        //reset the counter for next time,        app_timer_cancel(s_counter_timer);        count = 3;        //Alert chugger with short vibration        vibes_short_pulse();        //Start Accelerometer service        uint32_t num_samples = 5;        accel_data_service_subscribe(num_samples, data_handler);        accel_service_set_sampling_rate(ACCEL_SAMPLING_100HZ);    }    else    {        SINGLE_DIGIT_TO_ASCII(count, count_str);        text_layer_set_text(s_count_layer, count_str);        app_timer_register(1000, (AppTimerCallback) counter_timeout, NULL);    }}
开发者ID:seanmlyons22,项目名称:BeerRace,代码行数:25,


示例25: send

/*static void send(int key, int msg) {  DictionaryIterator *iter;  app_message_outbox_begin(&iter);  dict_write_int(iter, key, &msg, sizeof(int), true);  app_message_outbox_send();}*/static void inbox_received_handler(DictionaryIterator *iterator, void *context) {  // Get the first pair  Tuple *t = dict_read_first(iterator);  // Process all pairs present  while(t != NULL) {    // Process this pair's key    switch(t->key) {      case KEY_VIBRATE:        // Trigger vibration        text_layer_set_text(s_text_layer, "Vibrate!");        vibes_short_pulse();        break;       case KEY_DISTANCE:        // When distance recieved set text to distance        text_layer_set_text(s_text_layer,"Distance: ");        break;       case KEY_ETA:        text_layer_set_text(s_text_layer,"ETA:");        break;      default:        APP_LOG(APP_LOG_LEVEL_INFO, "Unknown key: %d", (int)t->key);        break;    }    // Get next pair, if any    t = dict_read_next(iterator);  }}
开发者ID:AustinTheMidget,项目名称:CashPointer,代码行数:38,


示例26: handle_bluetooth

static void handle_bluetooth(bool connected){	if(!connected)	{		if(vibrate) vibes_short_pulse();	}}
开发者ID:tprins228,项目名称:digilog,代码行数:7,


示例27: out_sent_handler

// App message callbacksvoid out_sent_handler(DictionaryIterator *sent, void *context){	//APP_LOG(APP_LOG_LEVEL_INFO, "command sent");		vibes_short_pulse();	start_reset_timer();}
开发者ID:karabox,项目名称:RingMyPhonePebble,代码行数:8,


示例28: update_time

static void update_time() {  time_t temp = time(NULL);   struct tm *tick_time = localtime(&temp);   min = tick_time->tm_min;  if(min == 59 && hour_vibrate == 1){    vibes_short_pulse();  }    if (clock_is_24h_style() == twenty_four_hour_format){    strftime(buffer, sizeof(buffer), "%H:%M", tick_time);  }else {    strftime(buffer, sizeof(buffer), "%I:%M", tick_time);  }      if(change_date_format == 1){    strftime(date, sizeof(date),"%d/%m/%y", tick_time);  } else{    strftime(date, sizeof(date),"%D", tick_time);  }  strftime(weekday, sizeof(weekday),"%A", tick_time);  for(char* pc=weekday;*pc!=0;++pc) *pc = lower_to_upper(*pc);    text_layer_set_text(lower_text_layer, date);  text_layer_set_text(upper_text_layer, buffer);  battery_handler(battery_state_service_peek());}
开发者ID:Aborgh,项目名称:toptobottom,代码行数:31,


示例29: tick_handler

static void tick_handler(struct tm *tick_time, TimeUnits units_changed) {  static char s_uptime_buffer[32];  vibes_short_pulse();  alert_time--;  if(alert_time <= 0 ){    //TODO: write notification code    tick_timer_service_unsubscribe();    vibes_cancel();    text_layer_set_text(s_alert_text_layer, "Timout Reached/n:(");        // Prepare dictionary    DictionaryIterator *iterator;    app_message_outbox_begin(&iterator);        // Write data    char buff[100];    if(persist_exists(PERSIST_KEY_PHONE_NUMBER)){      persist_read_string(PERSIST_KEY_PHONE_NUMBER, buff, 100);      dict_write_cstring(iterator, PERSIST_KEY_PHONE_NUMBER, buff);    }    if(persist_exists(PERSIST_KEY_NAME)){      persist_read_string(PERSIST_KEY_NAME, buff, 100);      dict_write_cstring(iterator, PERSIST_KEY_NAME, buff);    }    // Send the data!    app_message_outbox_send();      } else {    snprintf(s_uptime_buffer, sizeof(s_uptime_buffer), BANNER_TEXT "/n" CLOCK_FORMAT_STRING,              alert_time/60, alert_time%60);    text_layer_set_text(s_alert_text_layer, s_uptime_buffer);  }}
开发者ID:Herschee,项目名称:Watchdog,代码行数:33,


示例30: calibrate_handle_final

void calibrate_handle_final(Measurement m) {	// store the measurement	// check if same weight already exists and average both if it does	Measurement *mf = NULL;	for (int i = 0; i < calibrations_count; i++) {		if (calibrations[i].weight != weight)			continue;		mf = &calibrations[i];		mf->amp = (mf->amp + m.amp) / 2;		mf->freq = (mf->freq + m.freq) / 2;		mf->confidence = (mf->confidence + m.confidence) / 2;		break;	}	if (mf == NULL) {		m.weight = weight;		calibrations[calibrations_count++] = m;	}	// store	calibrations_save();		// stop measuring and update layers	stop_measure();	layer_mark_dirty(text_layer);	layer_mark_dirty(graph_layer);	// vibrate to let the user know	vibes_short_pulse();}
开发者ID:technicallyfeasible,项目名称:PebbleScale,代码行数:28,



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


C++ vice_ptr_to_int函数代码示例
C++ vibes_double_pulse函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。