Skip to content

Commit f5235ce

Browse files
committed
Demonstrate queue proper functionality
1 parent 8e4739f commit f5235ce

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

examples/Enqueue_test/Enqueue.inot

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void setup() {
2+
// put your setup code here, to run once:
3+
4+
}
5+
6+
int i = 0;
7+
8+
void loop() {
9+
// Continuously pump counter
10+
delay(100);
11+
i++;
12+
counter = i;
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
void setup() {
2+
// put your setup code here, to run once:
3+
Serial.begin(115200);
4+
while (!Serial) {}
5+
Enqueue.start();
6+
Serial.println("start");
7+
}
8+
9+
void loop() {
10+
// put your main code here, to run repeatedly:
11+
delay(1000);
12+
for (int i = 0; i < 10; i++) {
13+
Serial.println(counter);
14+
}
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Shared<int> counter;

0 commit comments

Comments
 (0)