commands:reference:filo
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판 | |||
| commands:reference:filo [2026/09/14 11:04] – 바깥 편집 127.0.0.1 | commands:reference:filo [2026/09/14 20:30] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 14: | 줄 14: | ||
| ===== 예제 ===== | ===== 예제 ===== | ||
| + | |||
| + | 시리얼 모니터에서 '' | ||
| <code cpp> | <code cpp> | ||
| - | uint16_t | + | uint16_t |
| - | uint16_t | + | uint16_t |
| - | uint16_t sequence | + | |
| void setup() { | void setup() { | ||
| 줄 25: | 줄 26: | ||
| void loop() { | void loop() { | ||
| - | | + | |
| - | const bool release | + | const char action = Serial.read(); |
| - | const bool reset = IdigitalRead(2, 5); // 입력을 여러 번 연속으로 읽고, 모든 값이 같을 때만 상태를 갱신합니다. HIGH와 LOW가 섞이면 이전 안정 상태를 유지합니다. | + | const bool store = action == ' |
| + | const bool retrieve = action == ' | ||
| + | const bool clearBuffer | ||
| + | if (store) ++nextNumber; | ||
| - | | + | const bool ok = FILO(0, store, |
| - | | + | FILO(0, |
| - | | + | if (retrieve |
| - | if (release | + | if (retrieve && !ok) Serial.println(F("Buffer empty")); |
| - | | + | |
| - | | + | |
| - | } | + | |
| } | } | ||
| </ | </ | ||
commands/reference/filo.1789351497.txt.gz · 마지막으로 수정됨: 저자 127.0.0.1
