本文整理汇总了C++中USART::putstr方法的典型用法代码示例。如果您正苦于以下问题:C++ USART::putstr方法的具体用法?C++ USART::putstr怎么用?C++ USART::putstr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USART
的用法示例。
在下文中一共展示了USART::putstr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loop
//.........这里部分代码省略.........
}
j = 7;
for(i = (serial0StringIdx - 1); i >= 0; i--) {
if(serial0String[i] >= '0' && serial0String[i] <= '9') {
if(j >= 0) {
IN12Num[j--] = serial0String[i] - 0x30;
}
} else if(serial0String[i] == ' ') {
if(j >= 0) {
IN12Num[j--] = 0x0F;
}
}
}
j = 8;
int previusCharValid = false;
for(i = (serial0StringIdx - 1); i >= 0; i--) {
if((serial0String[i] >= '0' && serial0String[i] <= '9') || serial0String[i] == ' ') {
previusCharValid = true;
if(j > 0) {
j--;
}
continue;
}
if(serial0String[i] == '.' && previusCharValid == true) {
IN12Com[j] = 1;
previusCharValid = false;
}
}
userDataTimerCount = userDataTimerValue;
}
if(isUserData == false) {
// コマンド処理
if(strncmp(serial0String, "help", 4) == 0) {
Serial1.putstr("set time YYMMDD hhmmss\r\n");
Serial1.putstr("set timeformat [0 or 1]\r\n");
Serial1.putstr("set dateinterval 99999\r\n");
Serial1.putstr("set datesec 99999\r\n");
Serial1.putstr("set udatasec 99999\r\n");
Serial1.putstr("set bright daytime [1 to 9]\r\n");
Serial1.putstr("set bright night [1 to 9]\r\n");
Serial1.putstr("set hour daytime [0 to 23]\r\n");
Serial1.putstr("set hour night [0 to 23]\r\n");
Serial1.putstr("set 12/24 format [0 or 1]\r\n");
Serial1.putstr("cathod -> Cathod poisoning\r\n");
Serial1.putstr("sekai -> STEINS;GATE like effect\r\n");
Serial1.putstr("save -> write EEPROM\r\n");
Serial1.putstr("show -> show all setting\r\n");
Serial1.putstr("time -> change to clock mode\r\n");
Serial1.putstr("\r\n");
Serial1.putstr("99999: numeric number 0 to 65535\r\n");
Serial1.putstr("---\r\n");
}
if(strncmp(serial0String, "set timeformat ", 15) == 0) {
unsigned int i = atoi(&serial0String[15]);
if(i == 0 || i == 1) {
dispTimeFormat = i;
sprintf(msg, "value = %d\r\n", dispTimeFormat);
Serial1.putstr(msg);
}
}
if(strncmp(serial0String, "set time ", 9) == 0) {
unsigned char year = ((serial0String[9] & 0x0F)<<4);
year |= serial0String[10] & 0x0F;
unsigned char month = ((serial0String[11] & 0x0F)<<4);
month |= serial0String[12] & 0x0F;
unsigned char days = ((serial0String[13] & 0x0F)<<4);