Skip to content

Commit

Permalink
feat: add 4 more examples (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverben authored May 20, 2024
1 parent 3053b39 commit 053a678
Show file tree
Hide file tree
Showing 16 changed files with 913 additions and 8 deletions.
118 changes: 118 additions & 0 deletions src/lib/examples/belly_sensor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"blocks": {
"languageVersion": 0,
"blocks": [
{
"type": "leaphy_start",
"id": "rzE0Ve:6bHB~8aIqyj-U",
"x": 154,
"y": 21,
"deletable": false,
"inputs": {
"STACK": {
"block": {
"type": "controls_repeat_forever",
"id": "in]|2;6|M/%ZJprATWW9",
"inputs": {
"DO": {
"block": {
"type": "controls_if",
"id": "d}Z3N:Vd_p;FPGdXzMkg",
"extraState": { "hasElse": true },
"inputs": {
"IF0": {
"block": {
"type": "logic_compare",
"id": "qUfB(/@n/0m3gf?SFisR",
"fields": { "OP": "EQ" },
"inputs": {
"A": {
"shadow": {
"type": "math_number",
"id": "3j.vABoGVR;8+,Kaw9`4",
"fields": { "NUM": 1 }
},
"block": {
"type": "leaphy_flitz_nano_read_stomach_sensor",
"id": "5uYOZNX1khsN5N=eIl;$"
}
},
"B": {
"shadow": {
"type": "math_number",
"id": "fERGPwz,,Kv_Os{ox6f*",
"fields": { "NUM": 1 }
}
}
}
}
},
"DO0": {
"block": {
"type": "leaphy_flitz_led",
"id": "|bfoixb}U4Y1*SY8E3dJ",
"inputs": {
"FLITZ_LED_R": {
"shadow": {
"type": "math_number",
"id": "rGo43JS:tPbp!/0A2~dB",
"fields": { "NUM": 0 }
}
},
"FLITZ_LED_G": {
"shadow": {
"type": "math_number",
"id": "()NYbmZe:zE3sJ.5q8fy",
"fields": { "NUM": 255 }
}
},
"FLITZ_LED_B": {
"shadow": {
"type": "math_number",
"id": "bmSyXLXD!u5{%P`~#e0,",
"fields": { "NUM": 0 }
}
}
}
}
},
"ELSE": {
"block": {
"type": "leaphy_flitz_led",
"id": "j^Vb{o8SQO6(o17tO/--",
"inputs": {
"FLITZ_LED_R": {
"shadow": {
"type": "math_number",
"id": "eg#UkKDIsIl6w(#,pmVc",
"fields": { "NUM": 0 }
}
},
"FLITZ_LED_G": {
"shadow": {
"type": "math_number",
"id": "0u`VTgZYUs]xoj|H$?:t",
"fields": { "NUM": 0 }
}
},
"FLITZ_LED_B": {
"shadow": {
"type": "math_number",
"id": "wfT6Ny5w%$c=6%B_Re7S",
"fields": { "NUM": 255 }
}
}
}
}
}
}
}
}
}
}
}
}
}
]
}
}
27 changes: 27 additions & 0 deletions src/lib/examples/belly_sensor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/lib/examples/belly_sensor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { RobotType } from "$domain/robots.types";
import icon from "./belly_sensor.svg";

export default {
name: "Belly sensor",
sketch: () => import("./belly_sensor.json"),
boards: [RobotType.L_FLITZ_NANO],
icon,
};
118 changes: 118 additions & 0 deletions src/lib/examples/blink_distance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"blocks": {
"languageVersion": 0,
"blocks": [
{
"type": "leaphy_start",
"id": "rzE0Ve:6bHB~8aIqyj-U",
"x": 215,
"y": 22,
"deletable": false,
"inputs": {
"STACK": {
"block": {
"type": "controls_repeat_forever",
"id": "BM5f*u*s1HTeuf{wXkGS",
"inputs": {
"DO": {
"block": {
"type": "controls_if",
"id": ")g$6iCq6{M7fZ0fekQc?",
"extraState": { "hasElse": true },
"inputs": {
"IF0": {
"block": {
"type": "logic_compare",
"id": "A7SGkU$N730`z$|tB^ZW",
"fields": { "OP": "LT" },
"inputs": {
"A": {
"shadow": {
"type": "math_number",
"id": "ayq#,3oQl/;w#+cv!*5r",
"fields": { "NUM": 1 }
},
"block": {
"type": "leaphy_original_get_distance",
"id": "-l]N2@hVF=BacXvt%kXU"
}
},
"B": {
"shadow": {
"type": "math_number",
"id": "Q;eMW;wYzL!vFA3p]t7l",
"fields": { "NUM": 20 }
}
}
}
}
},
"DO0": {
"block": {
"type": "leaphy_original_set_led",
"id": "d0C0fBiby0?}*Z3`fj*_",
"inputs": {
"LED_RED": {
"shadow": {
"type": "math_number",
"id": "r!4]TS^4bm#J8/oGcx[Q",
"fields": { "NUM": 0 }
}
},
"LED_GREEN": {
"shadow": {
"type": "math_number",
"id": "4NkmL2KsJ@dQU~vzQXcr",
"fields": { "NUM": 255 }
}
},
"LED_BLUE": {
"shadow": {
"type": "math_number",
"id": "Ig|t8m~bw34*#zLjVwEM",
"fields": { "NUM": 0 }
}
}
}
}
},
"ELSE": {
"block": {
"type": "leaphy_original_set_led",
"id": "b0`uJ7Q|1-DI7I8x6PGT",
"inputs": {
"LED_RED": {
"shadow": {
"type": "math_number",
"id": "V-xj:@.EA#k0m[1=8uEF",
"fields": { "NUM": 0 }
}
},
"LED_GREEN": {
"shadow": {
"type": "math_number",
"id": "~vsaTBv-zJI?Xm#eBIEo",
"fields": { "NUM": 0 }
}
},
"LED_BLUE": {
"shadow": {
"type": "math_number",
"id": "NCyfo,W?2~pInTGvpnJ[",
"fields": { "NUM": 255 }
}
}
}
}
}
}
}
}
}
}
}
}
}
]
}
}
Loading

0 comments on commit 053a678

Please sign in to comment.