aboutsummaryrefslogtreecommitdiff
path: root/Mussel
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-01 22:18:26 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-01 22:18:26 +0200
commit223894c7305a084130edfba75108c87b2c453691 (patch)
tree24c6110430cabc81c27584425e5fcca51c4e387b /Mussel
parentaaf35ec4d317224b6fa9a226479f0d56fc266eb0 (diff)
add library as appendix; add diagrams to library; drop individual mussel sketches
Diffstat (limited to 'Mussel')
-rw-r--r--Mussel/Mussel_begin.puml10
-rw-r--r--Mussel/Mussel_read.puml10
-rw-r--r--Mussel/examples/seconds/seconds.puml16
3 files changed, 36 insertions, 0 deletions
diff --git a/Mussel/Mussel_begin.puml b/Mussel/Mussel_begin.puml
new file mode 100644
index 0000000..17fb9fa
--- /dev/null
+++ b/Mussel/Mussel_begin.puml
@@ -0,0 +1,10 @@
+@startuml
+start
+if (type ?) equals (defined) then
+:init sensor driver;
+endif
+if (pin ?) equals (defined) then
+:configure input pin;
+endif
+stop
+@enduml
diff --git a/Mussel/Mussel_read.puml b/Mussel/Mussel_read.puml
new file mode 100644
index 0000000..d0bea40
--- /dev/null
+++ b/Mussel/Mussel_read.puml
@@ -0,0 +1,10 @@
+@startuml
+start
+:set time to current second;
+if (time mod 12 ?) equals (< 9) then
+:set gape to "42";
+else (>= 9)
+:set gape to "2";
+endif
+stop
+@enduml
diff --git a/Mussel/examples/seconds/seconds.puml b/Mussel/examples/seconds/seconds.puml
new file mode 100644
index 0000000..578983c
--- /dev/null
+++ b/Mussel/examples/seconds/seconds.puml
@@ -0,0 +1,16 @@
+@startuml
+'start
+:instantiate object;
+group init
+:activate object;
+:fetch and print object description;
+end group
+while (repeat every few millisecond)
+group loop {
+:fetch and print gape angle;
+:wait 1s;
+end group
+endwhile
+-[hidden]->
+kill
+@enduml