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


C++ Print::print方法代码示例

本文整理汇总了C++中Print::print方法的典型用法代码示例。如果您正苦于以下问题:C++ Print::print方法的具体用法?C++ Print::print怎么用?C++ Print::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Print的用法示例。


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

示例1: printTo

size_t IPAddress::printTo(Print& p) const {
    size_t n = 0;

    if (!isSet())
        return p.print(F("(IP unset)"));

#if LWIP_IPV6
    if (isV6()) {
        int count0 = 0;
        for (int i = 0; i < 8; i++) {
            uint16_t bit = PP_NTOHS(raw6()[i]);
            if (bit || count0 < 0) {
                n += p.printf("%x", bit);
                if (count0 > 0)
                    // no more hiding 0
                    count0 = -8;
            } else
                count0++;
            if ((i != 7 && count0 < 2) || count0 == 7)
                n += p.print(':');
        }
        return n;
    }
#endif

    for(int i = 0; i < 4; i++) {
        n += p.print((*this)[i], DEC);
        if (i != 3)
            n += p.print('.');
    }
    return n;
}
开发者ID:Juppit,项目名称:Arduino,代码行数:32,代码来源:IPAddress.cpp

示例2: motor_init

void slight_StepperManager::motor_init(Print &out) {
    out.println(F("setup stepper motor:"));
    // init motor
    out.println(F("\t set:"));
    out.println(F("\t     MICROSTEP_8"));
    out.println(F("\t     max speed 200 steps/s"));
    out.println(F("\t     acceleration 200 steps/s^2"));
    motor.begin(MICROSTEP_8, 200, 200);

    out.println(F("\t     limits:"));
    // int32_t limit = 12800;
    motor.forwardLimit = calibration_limit;
    motor.reverseLimit = -calibration_limit;
    // print current/new limits
    out.print(F("\t     * forwardLimit: "));
    out.print(motor.forwardLimit);
    out.println();
    out.print(F("\t     * reverseLimit: "));
    out.print(motor.reverseLimit);
    out.println();

    // motor.moveTo(6400);

    out.println(F("\t finished."));
}
开发者ID:s-light,项目名称:slight_StepperManager,代码行数:25,代码来源:slight_StepperManager.cpp

示例3: print_channel_state

void slave_status::print_channel_state(Print& out, const channel_state_t& state)
{
    switch (state)
    {
    case channel_working:
        out.print("Working Normally");
        break;

    case channel_disconnected:
        out.print("Disconnected / Solenoid Not Found");
        break;

    case channel_failed_short:
        out.print("Short-Circuited");
        break;

    case channel_failed_open:
        out.print("Failed Open-Circuit");
        break;

    default:
        out.print("Unknown / Invalid Channel Status");
        break;
    }
}
开发者ID:DAVe3283,项目名称:MIDI-Chimes,代码行数:25,代码来源:slave_status.cpp

示例4: PrintValue

void CApplicationMonitor::PrintValue(Print &rDestination, const __FlashStringHelper *pLabel, 
                                     uint32_t uValue, uint8_t uRadix, bool bNewLine) const
{
  rDestination.print(pLabel);
  rDestination.print(uValue, uRadix);
  if (bNewLine)
    rDestination.println();
}
开发者ID:UnforeseenOcean,项目名称:Highsight,代码行数:8,代码来源:ApplicationMonitor.cpp

示例5: print

void StringMap::print(Print &client, StringMapKey key) const {
  if (!this->contains(key)) return;
  char * s = this->find(key);
  if (!s) return;
  if (isProgmem(key))
    client.print((__FlashStringHelper *)s);
  else
    client.print(s);
}
开发者ID:nnaumenko,项目名称:iot_ambit,代码行数:9,代码来源:stringmap.cpp

示例6: printTo

size_t IPAddress::printTo(Print& p) const {
    size_t n = 0;
    for(int i = 0; i < 3; i++) {
        n += p.print(_address.bytes[i], DEC);
        n += p.print('.');
    }
    n += p.print(_address.bytes[3], DEC);
    return n;
}
开发者ID:2thetop,项目名称:Arduino,代码行数:9,代码来源:IPAddress.cpp

示例7: printErrorCb

void printErrorCb(RemoteAtCommandResponse& r, uintptr_t data) {
	Print *p = (Print*)data;
	if (!r.isOk()) {
		p->print(F("Error sending remote "));
		p->write(r.getCommand(), 2);
		p->print(F(" command. Status: "));
		p->println(r.getStatus());
	}
}
开发者ID:Introsys,项目名称:fresh,代码行数:9,代码来源:Printers.cpp

示例8: print_error

void slight_StepperManager::print_error(Print &out, error_t error) {
    switch (error) {
        case ERROR_none: {
            out.print(F("none"));
        } break;
        case ERROR_timeout: {
            out.print(F("timeout"));
        } break;
        case ERROR_limitswitch_wrong_dir: {
            // out.print(F("LimitSw wrong dir"));
            out.print(F("LimitSwDirection"));
        } break;
        case ERROR_limitswitchs: {
            out.print(F("LimitSw blocked"));
        } break;
        case ERROR_motorstart: {
            out.print(F("motor start"));
        } break;
        case ERROR_motorstop: {
            out.print(F("motor stop"));
        } break;
        case ERROR_calibrating: {
            out.print(F("calibrating"));
        } break;
        case ERROR_mechanics_moved: {
            out.print(F("mechanics moved"));
        } break;
        case ERROR_emergencystop: {
            out.print(F("emergency stop"));
        } break;
    }
}
开发者ID:s-light,项目名称:slight_StepperManager,代码行数:32,代码来源:slight_StepperManager.cpp

示例9: printLastError

void PBBP::printLastError(Print &p) {
    if (this->last_error < sizeof(error_code_str) / sizeof(*error_code_str))
        p.print(error_code_str[this->last_error]);
    else
        p.print(this->last_error);

    if (this->last_error == NACK) {
        p.print(", slave error code: 0x");
        p.print(this->last_slave_error, HEX);
    }
}
开发者ID:AdamMagaluk,项目名称:library-pinoccio,代码行数:11,代码来源:PBBP.cpp

示例10:

size_t IP64Address::printTo(Print& p) const
{
    size_t n = 0;
    for (int i =0; i < 7; i++)
    {
        n += p.print(_address[i], DEC);
        n += p.print('.');
    }
    n += p.print(_address[7], DEC);
    return n;
}
开发者ID:SankarMS,项目名称:TAMU_senior_design,代码行数:11,代码来源:IP64Address.cpp

示例11: printTo

size_t IPAddress::printTo(Print& p) const
{
    size_t n = 0;
    for (int i = 0; i < 4; i++)
    {
        if (n)
            n += p.print('.');
        n += p.print((*this)[i], DEC);
    }
    return n;
}
开发者ID:RobertNewkirk,项目名称:particle,代码行数:11,代码来源:spark_wiring_ipaddress.cpp

示例12: printTo

size_t IPAddress::printTo(Print& p) const
{
    size_t n = 0;
    for (int i =0; i < 3; i++)
    {
        n += p.print(((uint8_t*) & _address)[i], DEC);
        n += p.print('.');
    }
    n += p.print(((uint8_t*)&_address)[3], DEC);
    return n;
}
开发者ID:projnikdroid,项目名称:ARMWork,代码行数:11,代码来源:IPAddress.cpp

示例13: printResponseCb

void printResponseCb(AtCommandResponse& at, uintptr_t data) {
	Print *p = (Print*)data;
	p->println("AtCommandResponse received:");
	p->print(F("  Command: "));
	p->write(at.getCommand(), 2);
	p->println();
	printField(p, F("  Status: 0x"), at.getStatus());
	if (at.getValueLength()) {
		p->print(F("  Value: "));
		printHex(*p, at.getValue(), at.getValueLength(), F(" "), NULL);
		p->println();
	}
}
开发者ID:Introsys,项目名称:fresh,代码行数:13,代码来源:Printers.cpp

示例14: printTo

size_t MACAddress::printTo(Print& p) const
{
    size_t n = 0;
    for (int i =0; i < 7; i++)
    {
		if(_address[i]<16)
			n += p.print("0");
        n += p.print(_address[i], HEX);
        n += p.print(':');
    }
	if(_address[7]<16)
		n += p.print("0");
    n += p.print(_address[7], HEX);
    return n;
}
开发者ID:cevatbostancioglu,项目名称:ZigBee,代码行数:15,代码来源:MACAddress.cpp

示例15: printTo

size_t MACAddress::printTo(Print& p) const
{
    size_t n = 0;
    for (int i =0; i < 5; i++)
    {
	if (_address[i] < 0x10)
		n += p.print('0');
        n += p.print(_address[i], HEX);
        n += p.print(':');
    }
    if (_address[5] < 0x10)
        n += p.print('0');
    n += p.print(_address[5], HEX);
    return n;
}
开发者ID:spirilis,项目名称:AbstractWiring,代码行数:15,代码来源:MACAddress.cpp


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