이 라이브러리를 사용하여 부동 소수점을 문자열로 변환합니다 : http://www.arduino.cc/playground/Main/FloatToString?action=sourceblock&ref=1.Float to String Arduino 컴파일 오류
float flt = tempSensor.getTemperature();
char buffer[25];
char str[20];
Serial.print(floatToString(str, flt, 2, 10));
이 상자 밖으로 작동해야하지만하지 않습니다 - 나는 짜서 일을 할 않았다
이 코드의 조각 밖으로 인쇄 할 경우, FLT는 "29.37"처럼 보인다? 당신이 값이 누락있는 것처럼
.../floatToString.h:11: error: expected primary-expression before ',' token .../floatToString.h: In function 'char* floatToString(char*, float, int, int, bool)': .../floatToString.h:11: error: default argument missing for parameter 5 of 'char* floatToString(char*, float, int, int, bool)' .../floatToString.h:73: error: 'itoa' was not declared in this scope .../floatToString.h:89: error: 'itoa' was not declared in this scope
나는 완전한 해결책을 줄 정도로 익숙하지 않지만,'floatToString' 함수에 대한 매개 변수가 누락되었다는 것이 문제입니다. – Earlz