debugStart()는 디버그 출력에 사용할 포트와 보레이트를 설정합니다.
void debugStart()
void debugStart(unsigned long baudrate)
void debugStart(HardwareSerial& serialPort)
void debugStart(HardwareSerial& serialPort, unsigned long baudrate, uint8_t config = SERIAL_8N1)
| 명령어 | 인수 | 반환값 | 동작 |
|---|---|---|---|
debugStart() | 없음 | void | 디버그 출력에 사용할 포트와 보레이트를 설정합니다. |
const bool DEBUG_MODE = true; void setup() { if (DEBUG_MODE) { debugStart(115200); // 디버그 출력에 사용할 포트와 보레이트를 설정합니다. } } void loop() { checkInput(); checkOutput(); } void checkInput() { debug("AI0="); // 디버그가 활성화된 경우에만 값을 출력합니다. debugln(analogRead(A0)); // 지정한 채널의 원시 아날로그값을 읽습니다. / 디버그 값을 출력한 뒤 줄을 바꿉니다. } void checkOutput() { debug("millis="); // 디버그가 활성화된 경우에만 값을 출력합니다. debugln(millis()); // 디버그 값을 출력한 뒤 줄을 바꿉니다. }