当前位置: 首页>>代码示例>>C++>>正文


C++ sendByte函数代码示例

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


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

示例1: sendInt

void sendInt(unsigned int intToSend){
	unsigned int upperByte;
	unsigned int lowerByte;

	upperByte=intToSend & 0xFF00;//clear lower bits
	upperByte=upperByte >> 8; //shift to make it a char
	lowerByte=intToSend & 0x00FF; //clear upper bits

	sendByte(upperByte);
	sendByte(lowerByte);
} //sendInt()
开发者ID:duckboy81,项目名称:gitMe,代码行数:11,代码来源:XBeeModule.c

示例2: cm_read_caster_wheel_drop

/**
 * Returns 1 if the caster wheel is dropped.
 */
uint8_t cm_read_caster_wheel_drop(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_BUMP_DROP);
	endCommand();
	
	if (readByte() & 0x10)
		return 1;
	else
		return 0;
}
开发者ID:raceimaztion,项目名称:createSimulator,代码行数:15,代码来源:main.cpp

示例3: cm_read_right_bumper

/**
 * Returns 1 if the right bumper is pressed.
 */
uint8_t cm_read_right_bumper(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_BUMP_DROP);
	endCommand();
	
	if (readByte() & 0x01)
		return 1;
	else
		return 0;
}
开发者ID:raceimaztion,项目名称:createSimulator,代码行数:15,代码来源:main.cpp

示例4: cm_digital_outputs

/**
 * Sets the digital outputs on the Create's cargo bay connector.
 *   @param pin*: Turns the pin on if non-zero.
 * Note 1: Not used in simulations.
 * Note 2: Only available on Create robots. Does nothing on Roomba or Scooba robots.
 */
void cm_digital_outputs(const uint8_t &pin0, const uint8_t &pin1, const uint8_t &pin2)
{
	uint8_t b = 0;
	if (pin0)	b |= 0x01;
	if (pin1)	b |= 0x02;
	if (pin2)	b |= 0x04;
	
	sendByte(CmdOutputs);
	padCommand();
	sendByte(b);
	endCommand();
}
开发者ID:raceimaztion,项目名称:createSimulator,代码行数:18,代码来源:main.cpp

示例5: sendByte

// Send a Midi CC message to a given channel, as a given controller 0-127, with given
//  value 0-127
void Midi::sendControlChange(unsigned int channel, unsigned int controller, unsigned int value)
{
    int status = STATUS_EVENT_CONTROL_CHANGE | ((channel - 1) & 0x0f);
    
    
    if (sendFullCommands_ || (lastStatusSent_ != status)) {
        sendByte(status);
    }
    
    sendByte(controller & 0x7f);
    sendByte(value & 0x7f);
}
开发者ID:tymmothy,项目名称:TymmsArduinoMIDI,代码行数:14,代码来源:Midi.cpp

示例6: sendHeader

void iPodSerial::sendCommand(
    byte mode,
    byte cmdByte1,
    byte cmdByte2)
{
    sendHeader();
    sendLength(1 + 1 + 1);
    sendByte(mode);
    sendByte(cmdByte1);
    sendByte(cmdByte2);
    sendChecksum();
}
开发者ID:Blind029,项目名称:arduinaap,代码行数:12,代码来源:iPodSerial.cpp

示例7: sendFrame1

inline void sendFrame1(unsigned int value)
{
    unsigned int checksum=0xaa;
	serial_write(HDLC_frameFlag);
	
	sendByte(value);
	
	checksum ^= value;
	sendByte(checksum);
	
	serial_write(HDLC_frameFlag);
}
开发者ID:LOGre,项目名称:fpgaSynths,代码行数:12,代码来源:linestream.c

示例8: sendByte

void CompactQik2s9v1::motor1Forward(uint8_t speed)
{
	if ( speed > 127 )
	{
		sendByte(MOTOR1FORWARDFASTPACKET);
		sendByte(speed-127);	
	}
	else
	{
		sendByte(MOTOR1FORWARDPACKET);
		sendByte(speed);
	}
}
开发者ID:buzztoy,项目名称:qik2s9v1arduino,代码行数:13,代码来源:CompactQik2s9v1.cpp

示例9: accelReadReg

/*
 Reads a value from a ADXL345 register and returns it
 */
unsigned int accelReadReg(const Accel *a, int reg){
    int I2C = a->I2C;
    sendStart(I2C);                 // start transaction
    sendByte(I2C, a->write);        // write accel device
    sendByte(I2C, reg);             // specify device register
    repeatStart(I2C);
    sendByte(I2C, a->read);         // read accel device
    unsigned int d = readByte(I2C);          // grab data
    I2CAcknowledgeByte(I2C, 0);     // Send nack
    while(!I2CAcknowledgeHasCompleted(I2C));
    I2CStop(I2C);                   // end transaction
    return d;
}
开发者ID:conorpp,项目名称:school,代码行数:16,代码来源:main.c

示例10: KDC_5060R_receive

void KDC_5060R_receive(void){

  GPIO_ResetBits(CE_Port,CE_Pin);
  sendByte(CMD_OUTPUT);
  GPIO_SetBits(CE_Port,CE_Pin);

  key_data[0]=sendByte(0);
  key_data[1]=sendByte(0);
  key_data[2]=sendByte(0);
  key_data[3]=sendByte(0);

  GPIO_ResetBits(CE_Port,CE_Pin);
}
开发者ID:Alx2000y,项目名称:stm32f103_projects,代码行数:13,代码来源:KDC_5060R.c

示例11: read_adcNS

byte read_adcNS(byte ch, u16* iv)	// Read ADC, without entering SLEEP mode
	{
	byte res[2];
	if ((ch < 0) || (ch > 12))
		return INVARG;
	sendByte(READADC);
	sendByte(ch);
	*res = COMERR;
	sread(1, res);
	if (*res != 'D') return *res;
	if(sread(2, res) != 2) return COMERR;
	*iv = res[0] | (res[1] << 8);
	return 0;
	}
开发者ID:ArunJayan,项目名称:expeyes-programs,代码行数:14,代码来源:ejlib.c

示例12: sendString

void sendString(void){
	
	consoleDrawText(7, 5, "sending...");
	
	int length = strlen(str);
	
	sendByte(length);
	
	int i;
	for(i=0;i<length;i++){
		sendByte(str[i]);
	}

}
开发者ID:Aliandrana,项目名称:snesnet,代码行数:14,代码来源:Mode1.c

示例13: start

uint8_t I2C::write(uint8_t address, uint8_t registerAddress, uint8_t data)
{
  returnStatus = 0;
  returnStatus = start(); 
  if(returnStatus){return(returnStatus);}
  returnStatus = sendAddress(SLA_W(address));
  if(returnStatus){return(returnStatus);}
  returnStatus = sendByte(registerAddress);
  if(returnStatus){return(returnStatus);}
  returnStatus = sendByte(data);
  if(returnStatus){return(returnStatus);}
  returnStatus = stop();
  return(returnStatus);
}
开发者ID:bubgum,项目名称:crw-cmu,代码行数:14,代码来源:I2C.cpp

示例14: disable_actions

//------------------- Modifiers for Capture ------------------------------
byte disable_actions()
	{
	// Disable all modifiers to the capture call. The capture calls will be set to 
	// do analog triggering on the first channel captured.
	byte res[1];

	sendByte(SETACTION);
	sendByte(AANATRIG);
	sendByte(0);			//Self trigger on channel zero means the first channel captured
	*res = COMERR;
	sread(1,res);
	if(*res != 'D') return *res;
	return 0;
	}
开发者ID:ArunJayan,项目名称:expeyes-programs,代码行数:15,代码来源:ejlib.c

示例15: sendByte

void ChainableLED::setColorRGB(byte led, byte red, byte green, byte blue)
{
    // Send data frame prefix (32x "0")
    sendByte(0x00);
    sendByte(0x00);
    sendByte(0x00);
    sendByte(0x00);
    
    // Send color data for each one of the leds
    for (byte i=0; i<_num_leds; i++)
    {
        if (i == led)
        {
            _led_state[i*3 + _CL_RED] = red;
            _led_state[i*3 + _CL_GREEN] = green;
            _led_state[i*3 + _CL_BLUE] = blue;
        }
                    
        sendColor(_led_state[i*3 + _CL_RED], 
                  _led_state[i*3 + _CL_GREEN], 
                  _led_state[i*3 + _CL_BLUE]);
    }

    // Terminate data frame (32x "0")
    sendByte(0x00);
    sendByte(0x00);
    sendByte(0x00);
    sendByte(0x00);
}
开发者ID:AeroDoms,项目名称:GrovePi,代码行数:29,代码来源:ChainableLED.cpp


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