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

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

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

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

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

示例1: updateDisplay

void updateDisplay() {  int elapsed = 0;  int countdown = 0;  elapsed = s_currentTimer/2;  countdown = s_selectedDuration - elapsed;    if(s_currentTimer%2 == 0) {    static char bUp[10];    static char bDown[4];    //static char bDuration[10];    //static char bDuration[5];    //static int elapsed = 0;    //static int countdown = 0;        //elapsed = s_currentTimer/2;    //countdown = s_selectedDuration - elapsed;    if(countdown > 0) {      //printInt(s_countup, elapsed, bUp);      printInt(s_countdown, countdown, bDown);      //printInt(s_duration, s_selectedDuration, bDuration);            snprintf(bUp, 10, "%d / %d", elapsed, s_selectedDuration);      text_layer_set_text(s_countup, bUp);    } else {      printInt(s_countup, elapsed - s_selectedDuration, bUp);      //text_layer_set_text(s_duration, "");    }         if(countdown == 10) {      vibes_double_pulse();    } else if(countdown == 3) {      vibes_long_pulse();    } else if(countdown == 2 || countdown == 1) {      vibes_short_pulse();    } else if(countdown == 0) {      window_set_background_color(s_window, GColorWhite);      vibes_long_pulse();      s_timerActive = false;      updateMenu(s_selectedDuration);      text_layer_set_text(s_countdown, "");      text_layer_set_text(s_countup, "");      updateSets();    }  }    if(s_timerActive) {    if(countdown <= 10) {       window_set_background_color(s_window, GColorRed);    } else if (s_currentTimer < s_selectedDuration) {      window_set_background_color(s_window, GColorGreen);    } else {      window_set_background_color(s_window, GColorOrange);      if(s_currentTimer == s_selectedDuration) { // halfway point        vibes_double_pulse();      }     }  }}
开发者ID:eviltobz,项目名称:pebble_jim,代码行数:58,


示例2: menu_select_callback

static void menu_select_callback(MenuLayer *menu_layer, MenuIndex *cell_index, void *data) {	switch (cell_index->row) {    	case 0:			vibes_double_pulse();	  		checkin_send_request(venueid, venuename, 0, 0, 0, true);      		break;		case 1:			share_menu_show(!split_bar, venueid, venuename);			break;		case 2:			vibes_double_pulse();			checkin_send_request(venueid, venuename, 1, 0, 0, true);			break;	}}
开发者ID:thunsaker,项目名称:spoon,代码行数:15,


示例3: 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,


示例4: 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,


示例5: cdt_update

void cdt_update(SWTime sw_elapsed) {  // Preclude if disabled  if (cdt.enable == false) { return; }    // Invoke vibration alert  if (SWTime_compare(cdt.next_split, sw_elapsed) == -1 && cdt.overflow == false) {    // Call buzzer    vibes_double_pulse();  }  // Increment cdt_index until overflow condition detected (only in single mode)  // or cdt.next_split is greater than sw_elapsed  while (!cdt.overflow && (SWTime_compare(cdt.next_split, sw_elapsed)==-1)) {    cdt.index++;        // Exit condition for single mode    if (!cdt.repeat && (cdt.index >= cdt.length)) {      cdt.overflow = true;      break;    }        cdt.next_split = SWTime_add(cdt.next_split, cdt.lap[cdt.index%cdt.length]);  }    // Calculate displayed timer  cdt.display = cdt.overflow ?                SWTime_subtract(sw_elapsed, cdt.next_split) :                SWTime_subtract(cdt.next_split, sw_elapsed);    // Prevent displaying over 9:59:59.99  if (cdt.display.hour >= 10) {    cdt.display = (SWTime){.hour=9, .minute=59, .second=59, .centisecond=99};  }}
开发者ID:mrkoko,项目名称:racetime,代码行数:34,


示例6: bt_handler

static void bt_handler(bool connected) {  layer_set_hidden(s_bt_layer, connected);  if(!connected) {    vibes_double_pulse();  }}
开发者ID:C-D-Lewis,项目名称:brackets,代码行数:7,


示例7: end_round

void end_round() {    round_started = false;    club_menu_index = 0;	text_layer_set_text(&club, club_menu[club_menu_index]);	window_init(&finalscore, "Final Score");	window_stack_push(&finalscore, true /* Animated */);	text_layer_init(&finalscore_score, GRect(0, 0, 144, 168-16));	text_layer_set_background_color(&finalscore_score, GColorWhite);	text_layer_set_text_color(&finalscore_score, GColorBlack);	text_layer_set_font(&finalscore_score,fonts_get_system_font(FONT_KEY_GOTHAM_42_BOLD));	mini_snprintf(s_final_score, 25, "Final Score %d", totalshots);	text_layer_set_text(&finalscore_score, s_final_score);	text_layer_set_text_alignment(&finalscore_score, GTextAlignmentCenter);	layer_add_child(&finalscore.layer, &finalscore_score.layer);		text_layer_init(&finalscore_putts, GRect(0, 126, 144, 168-16-126));	text_layer_set_background_color(&finalscore_putts, GColorWhite);	text_layer_set_text_color(&finalscore_putts, GColorBlack);	text_layer_set_font(&finalscore_putts,fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));	mini_snprintf(s_final_putts, 25, "Total Putts: %d", totalputts);	text_layer_set_text(&finalscore_putts, s_final_putts);	text_layer_set_text_alignment(&finalscore_putts, GTextAlignmentCenter);	layer_add_child(&finalscore.layer, &finalscore_putts.layer);		vibes_double_pulse();	// Need to destroy list_of_shots array.	}
开发者ID:magic7s,项目名称:pebble_golfapp_poc,代码行数:28,


示例8: 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,


示例9: bluetooth_handler

static void bluetooth_handler (bool connected){      if(connected) {    #ifdef PBL_COLOR    text_layer_set_text_color(s_minute_layer , GColorSpringBud);    text_layer_set_text_color(s_hour_layer , GColorGreen);    #endif    }    else{        #ifdef PBL_COLOR    text_layer_set_text_color(s_hour_layer, GColorVividCerulean);    text_layer_set_text_color(s_minute_layer, GColorPictonBlue);        #endif  }          if (!connected && bluetooth_vibration == 1){      vibes_double_pulse();    }    else {        return;    }  persist_write_int(KEY_BLUETOOTH_VIBRATION, bluetooth_vibration);  }
开发者ID:turnervink,项目名称:CUTOFF,代码行数:28,


示例10: handle_init

void handle_init(AppContextRef ctx) {  window_init(&window, "Demo");  window_stack_push(&window, false /* Not animated */);  vibes_double_pulse();}
开发者ID:343max,项目名称:pebblekit,代码行数:7,


示例11: bluetooth_callback

// Record Bluetooth connection statestatic void bluetooth_callback(bool connected) {	  if (bt_toggle == 1) {         APP_LOG(APP_LOG_LEVEL_INFO, "Hide Bluetooth connection symbol");       if		(!connected) {bitmap_layer_set_bitmap(s_bt_icon_layer, gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BT_0));}      else	{bitmap_layer_set_bitmap(s_bt_icon_layer,gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BLANK));}			    			  } else {      APP_LOG(APP_LOG_LEVEL_INFO, "Show Bluetooth connection symbol");       if		(!connected) {bitmap_layer_set_bitmap(s_bt_icon_layer, gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BT_0));}	    else	{bitmap_layer_set_bitmap(s_bt_icon_layer,gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BT_1));}			      }  // set vibrations  if (!connected) {				if (vibe_on_disconnect == 1) {      APP_LOG(APP_LOG_LEVEL_INFO, "Vibrate on Bluetooth disconnect"); 			vibes_long_pulse();		}	} else {		if (vibe_on_connect == 1) {      APP_LOG(APP_LOG_LEVEL_INFO, "Vibrate on Bluetooth reconnection"); 			vibes_double_pulse();		}	}  }
开发者ID:NovaGL,项目名称:simpleface,代码行数:27,


示例12: tick_handler

/* * Tick-Handler - executes once every second using watch's internal clock. * Switched every other second between getting most recent temp (if desired) and checking for tripped alarm. */static void tick_handler(struct tm *tick_time, TimeUnits units_changed) {  if (tickTimerMod % 2 == 0){      if (wantAverage && !standbyEngaged && !tripped){        DictionaryIterator *iter;        app_message_outbox_begin(&iter);        int key = 0;        // send the message "b" to the phone, using key #0        Tuplet value = TupletCString(key, "b");        dict_write_tuplet(iter, &value);        app_message_outbox_send();      }  }  else{      //checks if alarm has been tripped, checks to see every 10 seconds if not      if (tripped){          text_layer_set_text(hello_layer, "INTRUDER ALERT!!!");          vibes_double_pulse();      }      else {           DictionaryIterator *iter;          app_message_outbox_begin(&iter);          int key = 0;          // send the message "t" to the phone, using key #0          Tuplet value = TupletCString(key, "t");          dict_write_tuplet(iter, &value);          app_message_outbox_send();      }  }  tickTimerMod += 1;}
开发者ID:RyCSmith,项目名称:WatchDog,代码行数:34,


示例13: display_time

void display_time(struct tm* tick_time) {    int h = tick_time->tm_hour;    int m = tick_time->tm_min;#ifdef DEBUG_MODE    h = m;    m = tick_time->tm_sec;    if ((m%5) != 0) return; //update every 5secs to allow time for animation#endif    if ((m_nVibes & MASKV_HOURLY) //option enabled to vibrate hourly        && (m == 0)) //hourly mark reached    {        int from = (m_nVibes & MASKV_FROM) >> 8,            to = m_nVibes & MASKV_TO;        bool bShake = false;        if (from <= to)        {            bShake = (h >= from) && (h <= to);        }        else        {            bShake = (h >= from) || (h <= to);        }        if (bShake)        {            vibes_double_pulse();        }    }
开发者ID:sdneon,项目名称:Enigma-plus,代码行数:28,


示例14: handle_tick

// Handles tick of the system clock.static void handle_tick(struct tm *tick_time, TimeUnits units_changed) {    if(units_changed & SECOND_UNIT) {      // Update control block.      control_block_tick();          // Redraw the timer.      draw_timer();          // Update UI.      if (control_block_is_program_over()){          // Vibrate with different pattern at the end of the program.          vibes_double_pulse();              // And update the screen with a final message.          layer_set_hidden((Layer *)tw_tl_time, true);          layer_set_hidden((Layer *)tw_tl_interval, true);              text_layer_set_text(tw_tl_type, "Done!");          layer_mark_dirty((Layer *)tw_tl_type);              return;      } else if (control_block_is_interval_over()){        vibes_long_pulse();      }    }  }
开发者ID:jango,项目名称:pebble_running,代码行数:28,


示例15: handle_tick

void handle_tick(AppContextRef ctx, PebbleTickEvent *t){  (void)t;  (void)ctx;  if(t->tick_time->tm_sec%10==0)  {     layer_mark_dirty(&minute_display_layer);          if(t->tick_time->tm_sec==0)     {        if(t->tick_time->tm_min%2==0)        {           layer_mark_dirty(&hour_display_layer);#if DISPLAY_DATE           if(t->tick_time->tm_min==0&&t->tick_time->tm_hour==0)           {              draw_date();           }#endif#if HOUR_VIBRATION           if(t->tick_time->tm_min==0                 &&t->tick_time->tm_hour>=HOUR_VIBRATION_START                    &&t->tick_time->tm_hour<=HOUR_VIBRATION_END)           {              vibes_double_pulse();           }#endif        }     }  }#if DISPLAY_SECONDS  layer_mark_dirty(&second_display_layer);#endif}
开发者ID:performa62,项目名称:pebble,代码行数:35,


示例16: 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,


示例17: tick_handler

static void tick_handler(struct tm *tick_time, TimeUnits units_changed){	set_time();		if(mins != 0 && (tick_time->tm_min +(tick_time->tm_hour*60))%mins == 0){		vibes_double_pulse();		APP_LOG(APP_LOG_LEVEL_DEBUG, "fmt");	}}
开发者ID:nmittu,项目名称:Nixie-Watch,代码行数:8,


示例18: game_end

static void game_end(unsigned finished){    if (finished) {        vibes_double_pulse();        debrief_user_with_score(game->score);        game->is_resetting = 1;    }}
开发者ID:phmagic,项目名称:snakey,代码行数:8,


示例19: bt_handler

static void bt_handler(bool connected) {	if (connected) {		vibes_short_pulse();	}	else {		vibes_double_pulse();	}}
开发者ID:PiwwowPants,项目名称:Sonic-Level-Start,代码行数:8,


示例20: handle_bt

static void handle_bt(bool bt_state){	if (last_bt_state && !bt_state)		vibes_double_pulse();	last_bt_state = bt_state;	layer_set_hidden(bitmap_layer_get_layer(bt_layer), bt_state);}
开发者ID:markshroyer,项目名称:pebble-bcdface,代码行数:8,


示例21: handle_bluetooth_event

static void handle_bluetooth_event(bool connected) {  if(BT_VIBE){  if (connected)    vibes_double_pulse();  else    vibes_short_pulse();  }}
开发者ID:Prieni,项目名称:revolving,代码行数:8,


示例22: bt_handler

static void bt_handler(bool connected) {  // Show current connection state  if (connected) {    vibes_long_pulse(); // vibrate long pulse when connection is back  } else {    vibes_double_pulse(); // vibrate two short pulses when connection is lost  }}
开发者ID:faquin,项目名称:miami-nights-pebble,代码行数:8,


示例23: bt_handler

static void bt_handler(bool connected) {  if(connected) {    layer_set_hidden(s_bt_layer, true);  } else {    vibes_double_pulse();    layer_set_hidden(s_bt_layer, false);  }}
开发者ID:chemu,项目名称:BarGraph,代码行数:8,


示例24: handle_vibe_packet

static void handle_vibe_packet(Simply *simply, Packet *data) {  VibePacket *packet = (VibePacket*) data;  switch (packet->type) {    case VibeShort: vibes_short_pulse(); break;    case VibeLong: vibes_long_pulse(); break;    case VibeDouble: vibes_double_pulse(); break;  }}
开发者ID:jdevoss1,项目名称:jsconf-pebble,代码行数:8,


示例25: bt_handler

static void bt_handler(bool connected) {#if defined(PBL_COLOR)  pge_set_background_color(connected ? data_get_color(ColorBackground) : GColorDarkGray);#endif  if(!connected) {    vibes_double_pulse();  }}
开发者ID:kevinlig,项目名称:isotime-appstore,代码行数:9,


示例26: handle_bluetooth

void handle_bluetooth(bool connected) {	int i;		if (lastBluetoothStatus == connected) {		return;	} else {		lastBluetoothStatus = connected;			if (splashEnded && !animRunning) {			if (animation_is_scheduled(anim)) {				animation_unschedule(anim);			}						animRunning = true;						for (i=0; i<NUMSLOTS; i++) {				slot[i].prevDigit = slot[i].curDigit;			}						slot[0].curDigit = 'B' - '0';			slot[1].curDigit = 'T' - '0';						if (connected) {				slot[2].curDigit = 'O' - '0';				slot[3].curDigit = 'K' - '0';				slot[4].curDigit  = SPACE_D;				slot[5].curDigit  = SPACE_D;				slot[6].curDigit  = SPACE_D;				slot[7].curDigit  = SPACE_D;				slot[8].curDigit  = SPACE_D;				slot[9].curDigit  = SPACE_D;				slot[10].curDigit = SPACE_D;				slot[11].curDigit = SPACE_D;				vibes_double_pulse();			} else {				slot[2].curDigit = SPACE_L;				slot[3].curDigit = SPACE_R;				slot[4].curDigit  = SPACE_D;				slot[5].curDigit  = 'F' - '0';				slot[6].curDigit  = 'A' - '0';				slot[7].curDigit  = 'I' - '0';				slot[8].curDigit  = 'L' - '0';				slot[9].curDigit  = 'E' - '0';				slot[10].curDigit = 'D' - '0';				slot[11].curDigit = SPACE_D;				vibes_long_pulse();			}						animation_schedule(anim);			app_timer_register(BATTERYDELAY, handle_timer, NULL);		}	}}
开发者ID:dmitre,项目名称:Blockslide-Date_2.0_reverce-pebble,代码行数:57,


示例27: s_display_error_msg

// displays error message and re-prompts for passwordstatic void s_display_error_msg(void *data) {    int i;  vibes_double_pulse();  s_curr_state = 4;  passcode_counter = 0;  for (i = 0; i < PASSCODE_LEN; i++) {    s_entry[i] = ' ';  }}
开发者ID:Tsukinara,项目名称:DangerZone,代码行数:10,


示例28: in_received_handler

static void in_received_handler(DictionaryIterator *iter, void *context) {  //Recieve data from phone  Tuple *buses_tuple = dict_find(iter, BUSES_KEY);  if (buses_tuple) {    vibes_double_pulse();    strncpy(buses,buses_tuple->value->cstring, 512);    text_layer_set_text(list_layer, buses);  }}
开发者ID:kiwiholmberg,项目名称:SLapp,代码行数:9,


示例29: bluetooth_callback

static void bluetooth_callback(bool connected) {	// Show icon if disconnected  layer_set_hidden(bitmap_layer_get_layer(s_bitmap_layer_bluetooth), !connected);  if(!connected) {    // Issue a vibrating alert    vibes_double_pulse();  }}
开发者ID:MusicalCreeper01,项目名称:Pebble-WordPress-Stats-Watchface,代码行数:9,


示例30: bluetooth_callback

static void bluetooth_callback(bool connected){  // show icon if disconnected  layer_set_hidden(bitmap_layer_get_layer(s_bt_icon_layer), !connected);  if(!connected){    // issue a vribrate alert    vibes_double_pulse();  }}
开发者ID:rtregaskis,项目名称:PebbleFace,代码行数:9,



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


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