en-us_commands:reference:fifo
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en-us_commands:reference:fifo [2026/09/07 23:35] – 바깥 편집 127.0.0.1 | en-us_commands:reference:fifo [2026/09/12 23:27] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== Example ===== | ===== Example ===== | ||
| + | |||
| + | Send '' | ||
| <code cpp> | <code cpp> | ||
| - | uint16_t | + | uint16_t |
| - | uint16_t | + | uint16_t |
| - | uint16_t sequence | + | |
| void setup() { | void setup() { | ||
| Serial.begin(115200); | Serial.begin(115200); | ||
| + | Serial.println(F(" | ||
| } | } | ||
| void loop() { | void loop() { | ||
| - | | + | |
| - | const bool release | + | const char key = Serial.read(); |
| - | const bool reset = IdigitalRead(2, | + | const bool store = key == ' |
| + | const bool take = key == ' | ||
| + | const bool reset = key == ' | ||
| + | | ||
| - | | + | const bool ok = FIFO(0, store, |
| - | | + | |
| - | | + | |
| - | if (release && fifoOk && filoOk) { | + | if (reset) { |
| - | Serial.print(F("oldest=")); Serial.print(fifoValue); | + | nextValue = 10; |
| - | Serial.print(F(" | + | Serial.println(F("buffer cleared")); |
| + | } else if (!ok) { | ||
| + | | ||
| + | } else if (store) { | ||
| + | Serial.print(F(" | ||
| + | Serial.println(nextValue); | ||
| + | nextValue += 10; | ||
| + | } else { | ||
| + | Serial.print(F(" | ||
| + | | ||
| } | } | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | Pushing to a full buffer or popping from an empty one fails. | ||
| ===== Precautions ===== | ===== Precautions ===== | ||
| '' | '' | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/fifo.1788791733.txt.gz · Last modified: by 127.0.0.1
