• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pulse函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TLC5940_SetGS_And_GS_PWM

void TLC5940_SetGS_And_GS_PWM(void) {
    uint8_t firstCycleFlag = 0;

    if (outputState(VPRG_PORT, VPRG_PIN)) {
        setLow(VPRG_PORT, VPRG_PIN);
        firstCycleFlag = 1;
    }

    uint16_t GSCLK_Counter = 0;
    uint8_t Data_Counter = 0;

    setLow(BLANK_PORT, BLANK_PIN);
    for (;;) {
        if (GSCLK_Counter > 4095) {
            setHigh(BLANK_PORT, BLANK_PIN);
            pulse(XLAT_PORT, XLAT_PIN);
            if (firstCycleFlag) {
                pulse(SCLK_PORT, SCLK_PIN);
                firstCycleFlag = 0;
            }
            break;
        } else {
            if (!(Data_Counter > TLC5940_N * 192 - 1)) {
                if (gsData[Data_Counter])
                    setHigh(SIN_PORT, SIN_PIN);
                else
                    setLow(SIN_PORT, SIN_PIN);
                pulse(SCLK_PORT, SCLK_PIN);
                Data_Counter++;
            }
        }
        pulse(GSCLK_PORT, GSCLK_PIN);
        GSCLK_Counter++;
    }
}
开发者ID:cdrfiuba,项目名称:marciano,代码行数:35,代码来源:main.c


示例2: pulse

void Skin::timerEvent(QTimerEvent* event)
{
  pulse(Pulse1, m_pulseDirection);
  auto invert = pulse(Pulse2, m_pulseDirection);
  if (invert)
    m_pulseDirection = !m_pulseDirection;
}
开发者ID:OSSIA,项目名称:Score,代码行数:7,代码来源:Skin.cpp


示例3: pulsesequence

void pulsesequence()
{
   double tro;
   char gread,gphase,gslice; 
   char grdname[MAXSTR];

   gread = 'z';
   if (getorientation(&gread,&gphase,&gslice,"orient") < 0) 
     abort_message("illegal value in orient parameter");
   gro = getval("gro");
   tro = getval("tro");
   getstr("gname",grdname);
   /* equilibrium period */
   status(A);
      hsdelay(d1);

   /* --- tau delay --- */
   status(B);
      pulse(p1, zero);
      hsdelay(d2);

   /* --- observe period --- */
   status(C);
   pulse(pw,oph);
   delay(0.0001);
   shapedgradient(grdname,tro,gro,gread,1,1); 
   hsdelay(d2);

   startacq(alfa);
   acquire(np,1.0/sw);
   endacq();
}
开发者ID:timburrow,项目名称:ovj3,代码行数:32,代码来源:gsh2pul.c


示例4: switch

float	WaspSensorGas::readValue(uint16_t sensor)
{
	uint16_t aux=0;
	switch( sensor )
	{
		case	SENS_TEMPERATURE	:	aux=analogRead(ANALOG1);
							break;
		case	SENS_HUMIDITY		:	aux=analogRead(ANALOG4);
							break;
		case	SENS_PRESSURE		:	aux=analogRead(ANALOG5);
							break;
		case	SENS_CO2		:	aux=analogRead(ANALOG3);
							break;
		case	SENS_O2			:	aux=analogRead(ANALOG3);
							break;
		case	SENS_SOCKET2A		:	aux=analogRead(ANALOG2);
							break;
		case	SENS_SOCKET2B		:	aux=analogRead(ANALOG2);
							break;
		case	SENS_SOCKET3A		:	aux=analogRead(ANALOG7);
							break;
		case	SENS_SOCKET3B		:	aux=pulse(SENS_SOCKET3B);
							break;
		case	SENS_SOCKET3C		:	aux=pulse(SENS_SOCKET3C);
							break;
		case	SENS_SOCKET4A		:	aux=analogRead(ANALOG6);
							break;
		case	SENS_SOCKET4B		:	aux=pulse(SENS_SOCKET4B);
							break;
		case	SENS_SOCKET4C		:	aux=pulse(SENS_SOCKET4C);
							break;
	}
	return	(aux*3.3)/1023;
}
开发者ID:ipadron,项目名称:waspmote-api,代码行数:34,代码来源:WaspSensorGas.cpp


示例5: setup

void setup() {
    Serial.begin(19200);
    pinMode(LED_PMODE, OUTPUT);
    pulse(LED_PMODE, 2);
    pinMode(LED_ERR, OUTPUT);
    pulse(LED_ERR, 2);
    pinMode(LED_HB, OUTPUT);
    pulse(LED_HB, 2);
}
开发者ID:genejones,项目名称:avr-rascal,代码行数:9,代码来源:avrdude.c


示例6: pulse

void AD9850::down() {
    pulse(FQ_UD);
    uint8_t p = 0x04;
    for (int i = 0; i < 8; i++, p >>= 1) {
        digitalWrite(D7, p & (uint8_t)0x01);
        pulse(W_CLK);
    }
    pulse(FQ_UD);
}
开发者ID:jontio,项目名称:JMSK,代码行数:9,代码来源:AD9850.cpp


示例7: W_CLK

AD9850::AD9850(char w_clk, char fq_ud, char d7)
    : W_CLK(w_clk), FQ_UD(fq_ud), D7(d7) {
    frequency = 0;
    phase = 0;
    pinMode(W_CLK, OUTPUT);
    pinMode(FQ_UD, OUTPUT);
    pinMode(D7, OUTPUT);
    pulse(W_CLK);
    pulse(FQ_UD);
}
开发者ID:jontio,项目名称:JMSK,代码行数:10,代码来源:AD9850.cpp


示例8: pinMode

void AD9850::begin_priv() {
	pinMode(W_CLK, OUTPUT);
	pinMode(FQ_UD, OUTPUT);
	pinMode(DATA, OUTPUT);
	pinMode(RESET, OUTPUT);
	
	pulse(RESET);
	pulse(W_CLK);
	pulse(FQ_UD);
}
开发者ID:F4GOJ,项目名称:AD9850,代码行数:10,代码来源:AD9850.cpp


示例9: pinMode

DHT11Result DHT11::read()
{
  pinMode(_pin, OUTPUT);
  digitalWrite(_pin, LOW);
  delay(20);

  uint32_t cycles[80];

  noInterrupts();
  {
    pinMode(_pin, INPUT_PULLUP);

    if (pulseIn(_pin, HIGH) == 0) {
      return prepareErrorResult("Timeout waiting for start signal LOW pulse");
    }

    for (int i = 0; i < 80; i+= 2) {
      cycles[i] = pulse(LOW, 150);
      cycles[i + 1] = pulse(HIGH, 150);
    }

    interrupts();
  }

  uint32_t data[5];
  data[0] = data[1] = data[2] = data[3] = data[4] = 0;

  for (int i = 0; i < 40; ++i) {
    uint32_t lowCycles  = cycles[2 * i];
    uint32_t highCycles = cycles[2 * i + 1];

    data[i/8] <<= 1;

    if (highCycles > lowCycles) {
      data[i/8] |= 1;
    }
  }

  uint32_t calculatedParity = (data[0] + data[1] + data[2] + data[3]) & 0xFF;

  if (data[4] != calculatedParity)
  {
    return prepareErrorResult("Parity check failed");
  }

  DHT11Result result;
  result.hasError = false;
  result.errorMessage = "";
  result.humidity = data[0];
  result.temperatureC = data[2];
  return result;
}
开发者ID:fduman,项目名称:dht11_esp8266,代码行数:52,代码来源:dht11sensor.cpp


示例10: digitalWrite

void AD9850::update() {
    uint32_t f = frequency;
    for (int i = 0; i < 32; i++, f >>= 1) {
        digitalWrite(D7, f & (uint32_t)0x00000001);
        pulse(W_CLK);
    }
    uint8_t p = phase;
    for (int i = 0; i < 8; i++, p >>= 1) {
        digitalWrite(D7, p & (uint8_t)0x01);
        pulse(W_CLK);
    }
    pulse(FQ_UD);
}
开发者ID:jontio,项目名称:JMSK,代码行数:13,代码来源:AD9850.cpp


示例11: set_rows

void set_rows(uint16_t data, uint8_t direction) {
    for(uint8_t i=0; i<ROWS; i++) {
        if(((data & (1<<i))>>i) == 1) {
            if(direction == 1) {
                set_row(i,((data & (1<<i))>>i));
                pulse();
                set_row(i,0);
            } else {
                clear_row(i,((data & (1<<i))>>i));
                pulse();
                clear_row(i,0);
            }
        }
开发者ID:Bouni,项目名称:flipdot,代码行数:13,代码来源:flipdot.c


示例12: pulse

void Varilabel::mouseMoveEvent( QMouseEvent *e )
{
    static int previous_y;
    
    // 1 pulse every 10 pixels
    if ( e->y() > previous_y + 10 || e->y() < previous_y - 10) {
        if ( e->y() > previous_y ) emit pulse( -1 );
        else emit pulse( 1 );
        previous_y = e->y();
    }

    // 1 pulse every pixel
    emit y( e->y() );
}
开发者ID:glenoverby,项目名称:sdr-shell-v4,代码行数:14,代码来源:varilabel.cpp


示例13: pulsesequence

pulsesequence()
{
   /* equilibrium period */
   status(A);
   hsdelay(d1);

   /* --- tau delay --- */
   status(B);
   pulse(p1, zero);
   hsdelay(d2);

   /* --- observe period --- */
   status(C);
   pulse(pw,oph);
}
开发者ID:timburrow,项目名称:ovj3,代码行数:15,代码来源:gnoesyNhsqc_CN.c


示例14: pulsesequence

pulsesequence()
{
  char lkflg[MAXSTR];
  getstr("lkflg",lkflg);
  status(A);
   dec3blank();
  if (lkflg[A]=='y') lk_sample();
   hsdelay(d1);
  status(B);
   pulse(p1, zero);
   hsdelay(d2);
  status(C);
   pulse(pw,oph);
   if (lkflg[A]=='y') lk_hold();
   dec3unblank();
}
开发者ID:timburrow,项目名称:ovj3,代码行数:16,代码来源:rna_ddec_s2pul.c


示例15: protocol_send

bool
protocol_send(uint16_t address, uint16_t command, sent_cb_t* cb)
{
	// gpiote0 (toggles gpio)
	NRF_GPIOTE->POWER = GPIOTE_POWER_POWER_Enabled << GPIOTE_POWER_POWER_Pos;
	nrf_gpiote_task_config(0, context.led_pin, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_LOW);

	if (context.state != PROTOCOL_STATE_IDLE) {
		return false;
	}
	context.state = PROTOCOL_STATE_PREAMBLE_DONE;
	context.address = address;
	context.command = command;
	context.cb = cb;
	NRF_POWER->TASKS_CONSTLAT = 1; // PAN 11 "HFCLK: Base current with HFCLK running is too high"
	NRF_RTC1->TASKS_STOP = 1;
	NRF_RTC1->TASKS_CLEAR = 1;
	NRF_RTC1->PRESCALER = ROUNDED_DIV(LFCLK_FREQUENCY,
		ROUNDED_DIV(1000000,
			context.protocol->preamble.leader + context.protocol->preamble.pause - RTC_TASK_JITTER
			)) - 1;
	NRF_RTC1->CC[0] = 1;
	NRF_RTC1->TASKS_START = 1;
	pulse(ROUNDED_DIV(context.protocol->preamble.leader, context.protocol->pulse_width));
	return true;
}
开发者ID:relayr,项目名称:relayr-firmware-nrf51-modules,代码行数:26,代码来源:protocol.c


示例16: set_pin

void LiquidCrystal::send(uint8 cmd, bool mode)
{
    set_pin(rs_pin, mode);
    etk::Bits<uint8> b(cmd);

    for (int i = 4; i < 8; i++)
        set_pin(data_pins[i-4], b.read_bit(i));

    pulse();

    for (int i = 0; i < 4; i++)
        set_pin(data_pins[i], b.read_bit(i));

    pulse();
    busy_wait();
}
开发者ID:supercamel,项目名称:ninjaskit_thermocouple,代码行数:16,代码来源:lcd.cpp


示例17: if

void inputParameters::parseFieldInfo(boost::property_tree::ptree &IP)
{
  if (jobtype_ == JOBTYPE::ADIABATIC)
  {
  // Import parameters
    initial_intensity_   = IP.get<double>("Field.initial_intensity",1.0e8);
    final_intensity_     = IP.get<double>("Field.final_intensity",1.0e12);
    intensity_increment_ = IP.get<double>("Field.intensity_increment",10.0);
    add_increment_       = IP.get<bool>("Field.add_increment",false);
  // Change to atomic units
    initial_intensity_ /= CONSTANTS::LASERINTEN;
    final_intensity_   /= CONSTANTS::LASERINTEN;
    if (add_increment_)
      intensity_increment_ /= CONSTANTS::LASERINTEN;
  }
  else if (jobtype_ == JOBTYPE::NONADIABATIC)
  {
    double FWHMFactor = 2.0*sqrt(2.0*log(2.0));
    for (auto &p : IP.get_child("Field.pulses"))
    {
      double sig = p.second.get<double>("pulse_fwhm",100.0)*CONSTANTS::AUperFS/ FWHMFactor;
      pulses_.push_back( pulse(
        p.second.get<double>("pulse_max_intensity",1.0e12)/CONSTANTS::LASERINTEN,
        sig,
        p.second.get<double>("pulse_center",10.0)*CONSTANTS::AUperFS));
    }
  }
}
开发者ID:Seideman-Group,项目名称:AlignmentCalculator,代码行数:28,代码来源:inputs.cpp


示例18: pulsesequence

pulsesequence()
{
   double	pp;
		

   pp = getval("pp");
   
/* calculate phases */
  mod2(ct,v1);  /* 0101 */
  dbl(v1,v1);   /* 0202 */
  hlv(ct,v2);   /* 0011 2233 */
  mod2(v2,v2);  /* 0011 0011 */
  add(v1,v2,v1);  /* 0213 0213*/
  assign(v1,oph); 


  

   status(A);
      hsdelay(d1);
   status(B);
      pulse(pw, v1);
      delay(d2);
         if (declvlonoff)
            declvlon();         /* sets power to pplvl */
         else
            decpower(pplvl);
      simpulse(p1, pp, v1, v1, rof1, rof1);
         if (declvlonoff)
            declvloff();
         else
            decpower(dpwr);
      delay(d2);
   status(C);
}
开发者ID:timburrow,项目名称:ovj3,代码行数:35,代码来源:ppcal.c


示例19: pulse

void SR04::read()
{
  if (millis() - pulseTime > 100) {
    pulse();
    return;
  }
  if (!pulsed) {
    return;
  }
  long now = micros();
  if (now - time < 500) {
    return;
  } else {
    if (now - time > 3000) {
      calibrate(3000);
      return;
    } else {
      if (digitalRead(_echo) == 0) {
        calibrate(now - time);
        return;
      } else {
        return;
      }
    }
  }
}
开发者ID:f-w-robots,项目名称:RBT,代码行数:26,代码来源:SR04.cpp


示例20: pulsesequence

void pulsesequence()
{
   double gzlvl1,gt1;
   char gradaxis[MAXSTR];
   getstrnwarn("gradaxis",gradaxis);
   if (( gradaxis[0] != 'x') && ( gradaxis[0] != 'y') && ( gradaxis[0] != 'z') )
      strcpy(gradaxis,"z");

   gzlvl1 = getval("gzlvl1");
   gt1 = getval("gt1");

   
   status(A);
   read_in_eddys(gradaxis[0]);
   delay(d1);

   status(B);
   rgradient(gradaxis[0],0.0);
   send_eddys(gradaxis[0],0.00005);
   
   delay(2e-3);
   shgradpulse(gzlvl1,gt1);
     
   delay(d2);

   status(C);
   pulse(pw,oph);
}
开发者ID:timburrow,项目名称:ovj3,代码行数:28,代码来源:g2pul_ecc.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pulseEnable函数代码示例发布时间:2022-05-30
下一篇:
C++ pull函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap