本文整理汇总了C++中settings::setDigitalInputs方法的典型用法代码示例。如果您正苦于以下问题:C++ settings::setDigitalInputs方法的具体用法?C++ settings::setDigitalInputs怎么用?C++ settings::setDigitalInputs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings
的用法示例。
在下文中一共展示了settings::setDigitalInputs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processDisk
//.........这里部分代码省略.........
}
while (*ptr != '\r' && *ptr != '\0' && *ptr != '\n'){
ptr++;
}
while (*ptr == '\r' && *ptr == '\n'){
ptr++;
}
if (*ptr == '\0'){
break;
}
}
}
// contains the settings for the digital I/O pins (for FRC, aka ChapR3 of EEPROM)
if (readFile("dgtlIn.txt", buf, BIGENOUGH)){
byte newNum = 0;
for (int i = 0, ptr = 0; i < 8; i++){
byte bit = (buf[ptr] == '1')?1:0;
newNum |= bit<<i;
while (buf[ptr] != '\r' && buf[ptr] != '\0' && buf[ptr] != '\n'){
ptr++;
}
while (buf[ptr] == '\r' || buf[ptr] == '\n'){
ptr++;
}
if (buf[ptr] == '\0'){
break;
}
}
myEEPROM.setDigitalInputs(newNum);
}
// contains the 4 analog inputs (for FRC, aka ChapR3 of EEPROM)
if (readFile("analogIn.txt", buf, BIGENOUGH)){
char *ptr = buf;
for (int i = 0; i < 4; i++){
double value = atof(ptr);
if (value > 0 && value <= 5) {
value = (value*1023)/5;
// TODO - translate to labview preferences here
switch(i) {
case 0: myEEPROM.setAnalogInput1(value); break;
case 1: myEEPROM.setAnalogInput2(value); break;
case 2: myEEPROM.setAnalogInput3(value); break;
case 3: myEEPROM.setAnalogInput4(value); break;
}
}
while (*ptr != '\r' && *ptr != '\0' && *ptr != '\n'){
ptr++;
}
while (*ptr == '\r' || *ptr == '\n'){
ptr++;
}
if (*ptr == '\0'){
break;
}
}
}
// get a target bluetooth connection name/ID AND connect if it is there
// this MAY need to be changed to do the connection AFTER getting