commands:reference:ipidoutput
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
| commands:reference:ipidoutput [2026/09/01 20:04] – 만듦 - 바깥 편집 127.0.0.1 | commands:reference:ipidoutput [2026/09/14 20:30] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 11: | 줄 11: | ||
| ^ 명령어 ^ 인수 ^ 반환값 ^ 동작 ^ | ^ 명령어 ^ 인수 ^ 반환값 ^ 동작 ^ | ||
| | '' | | '' | ||
| + | |||
| ===== 예제 ===== | ===== 예제 ===== | ||
| + | |||
| + | MPINO-16A8R8T의 A0 아날로그 입력을 0~1023의 원시값으로 읽어 PID 계산에 사용합니다. 이 예제는 계산 결과를 시리얼 모니터에만 표시하며 출력 단자를 구동하지 않습니다. A0의 전압·전류 설정은 실제 연결한 센서에 맞춰 확인하십시오. | ||
| <code cpp> | <code cpp> | ||
| - | bool IpidSet(uint8_t id, float kp, float ki, float kd, unsigned long sampleMs, float outMin, float outMax); | + | const uint8_t PID_ID = 0; |
| - | float IpidRun(uint8_t id, float pv, float sv); | + | |
| - | void IpidReset(uint8_t id); | + | void setup() { |
| - | void IpidReverse(uint8_t id, bool reverse); | + | Serial.begin(115200); |
| - | void IpidItermLimit(uint8_t id, float iMin, float iMax); | + | |
| - | float IpidOutput(uint8_t id); | + | } |
| + | |||
| + | void loop() { | ||
| + | const float currentValue = analogRead(A0); // A0의 ADC 원시값을 읽습니다. | ||
| + | | ||
| + | const float lastResult = IpidOutput(PID_ID); // 마지막으로 계산된 PID 출력값을 읽습니다. | ||
| + | | ||
| + | delay(100); | ||
| + | } | ||
| </ | </ | ||
| 줄 31: | 줄 42: | ||
| * '' | * '' | ||
| * 같은 '' | * 같은 '' | ||
| + | |||
| + | ===== 같은 카테고리의 내장 명령어 ===== | ||
| + | |||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| [[commands: | [[commands: | ||
commands/reference/ipidoutput.1788260661.txt.gz · 마지막으로 수정됨: 저자 127.0.0.1
