Arduino/Arduino Common3 문자열 분리하기 const char DelimeterChar = ','; const char TerminatorChar = '\n'; String readString; String firstString; String secondString; String thirdString; int firstDelimeter = 0; int secondDelimeter = 0; void setup() { Serial.begin(9600); } void loop() { if (Serial.available() > 0) { readString = Serial.readStringUntil(TerminatorChar); } else { delay(1); return; } Serial.print("Read String : "); Serial.p.. 2022. 7. 31. Class 만들어 사용하기 클래스 만들기 DoServo.h #include class DoServo { private: Servo servo; public: DoServo(int pin); ~DoServo(); void Attach(int pin); void Detach(); void Write(int angle); int Read(); }; DoServo.cpp #include "DoServo.h" DoServo::DoServo(int pin) { Attach(pin); } DoServo::~DoServo() { Detach(); } void DoServo::Attach(int pin) { servo.attach(pin); } void DoServo::Detach() { servo.detach(); } void DoServo::.. 2022. 7. 31. VSCode 에서 아두이노 개발하기 1. VSCode 설치 https://code.visualstudio.com/ Visual Studio Code - Code Editing. Redefined Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. code.visualstudio.com 2. Arduino 확장 설치 3. 프로젝트를 저장할 폴더 설정 파일 - 폴더 열기 4. 아두이노 프로젝트 생성 도움말 - .. 2022. 7. 30. 이전 1 다음