zorg_17
Last Modified: 2024-03-17 07:09:14
Created On: 2023-12-10 15:58:46
Owned By: evezor
Created By: anfro
Contributors: anfro, evezor
Public: True
Executable
# --------------------------------------
# zorg_17
# 65f6971a7bcf6ed6canv
__canvas_id__ = '65f6971a7bcf6ed6'
# __version__ = TODO: add this
# --------------------------------------
from floe import FP
from NeoPixel import NeoPixel
from SDCard import SDCard
from DigitalOutput import DigitalOutput
from GuiCheckbox import GuiCheckbox
from DigitalInput import DigitalInput
from WebsocketServer import WebsocketServer
from HbtLed import HbtLed
from Zorg import Zorg
from ESP32Core import ESP32Core
from CANBus import CANBus
def setup(iris):
CANBus(name="CANBus", pid=6545, rx=16, tx=4, adr=10, bus=0, baud=250000, rx_queue=25, terminal_debug=False, debug=False, active=True, bcast=False, iris=iris)
DigitalInput(name="button_a", pid=17754, pin=34, pullup='None', debounce=200, invert=True, initial_value=False, datatype="bool", debug=True, active=True, bcast=False, iris=iris)
DigitalInput(name="button_b", pid=12955, pin=26, pullup='pullup', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name="button_c", pid=12806, pin=14, pullup='pullup', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name="button_d", pid=4163, pin=12, pullup='pullup', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name="function_button", pid=2276, pin=36, pullup='None', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalOutput(name="led_a", pid=5558, pin=33, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
DigitalOutput(name="led_b", pid=59323, pin=25, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
DigitalOutput(name="led_c", pid=52957, pin=21, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
DigitalOutput(name="led_d", pid=55135, pin=22, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
ESP32Core(name="ESP32Core", pid=6074, wifi=True, hbt_led=FP(55894), neo_status=FP(47403), function_button=FP(2276), bus=FP(6545), zorg=FP(21885), webserver=FP(43499), debug=False, active=True, bcast=False, iris=iris)
GuiCheckbox(name="GuiCheckbox", pid=59197, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
HbtLed(name="hbt_led", pid=55894, pin=15, delay=1000, datatype="int", debug=False, active=True, bcast=False, iris=iris)
NeoPixel(name="neo_status", pid=47403, pin=17, number_of_pixels=1, animation=0, delay=200, animations=None, datatype="rgb", debug=False, active=True, bcast=False, iris=iris)
SDCard(name="SDCard", pid=25805, slot=2, auto_mount=False, debug=False, active=True, bcast=False, iris=iris)
WebsocketServer(name="WebsocketServer", pid=43499, datatype="null", debug=False, active=True, bcast=False, iris=iris)
Zorg(name="Zorg", pid=21885, debug=False, active=True, bcast=False, iris=iris)
iris.add_hots({"5558": [59197], "52957": [12806], "55135": [4163]})
Canvas View:
Dependencies:
["NeoPixel", "CANBus", "DigitalOutput", "FileSender", "GuiCheckbox", "DigitalInput", "FileReceiver", "WebsocketServer", "HbtLed", "Parameter", "Zorg", "ESP32Core", "SDCard"]
Uppie code:
this code is used as the constructor in this canvas is dropped on a canvas above
{
"canvas_id": "65742b61b77c94e8canv",
"zorg": true,
"busses": {
"CANBus": "10"
},
"ports": [
{
"name": "button_a",
"reference_id": "14ebbd38-779e-55a6-9269-cc6e5ee4d743",
"pid": 17754,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "button_b",
"reference_id": "7dca15d9-7cf6-7d94-e192-93e98eaf7de8",
"pid": 12955,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "button_c",
"reference_id": "4f5432db-959c-12f4-10ca-f832fb26d900",
"pid": 12806,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "button_d",
"reference_id": "4284ad30-ea08-623b-3135-bee6999da0ee",
"pid": 4163,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "led_a",
"reference_id": "cb264ac7-3366-a68b-6113-affe4c8a78b7",
"pid": 5558,
"type": "input",
"datatype": "bool",
"parameter_type": "DigitalOutput"
},
{
"name": "led_b",
"reference_id": "d556e72c-29d2-c3bd-e1bb-e2b91932592a",
"pid": 59323,
"type": "input",
"datatype": "bool",
"parameter_type": "DigitalOutput"
},
{
"name": "led_c",
"reference_id": "1902bc72-846a-8538-d8b1-2b20de140f62",
"pid": 52957,
"type": "input",
"datatype": "bool",
"parameter_type": "DigitalOutput"
},
{
"name": "led_d",
"reference_id": "6fa0586f-bedc-3903-f464-9955478f3e98",
"pid": 55135,
"type": "input",
"datatype": "bool",
"parameter_type": "DigitalOutput"
}
]
}
Uppie subs:
{}
Canvas code:
[
{
"type": "CanvasID",
"id": "65f6971a7bcf6ed6canv",
"x": 10,
"y": 10,
"selectable": false,
"draggable": true,
"text": "CanvasID: 65f6971a7bcf6ed6canv",
"canvas_type": "core"
},
{
"type": "Parameter",
"name": "ESP32Core",
"id": "9e65d461-88ea-d923-2508-c70738045031",
"ParameterType": "ESP32Core",
"datatype": null,
"pid": "6074",
"x": 1567.9877000000001,
"y": 248.12341298828142,
"width": 94,
"height": 86,
"constants": {
"wifi": true
},
"up_data": {
"can_go_up": false,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "function_button",
"id": "755f08c5-a527-574e-94c4-ec22787d7c83",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 2276,
"x": 1297.9877000000001,
"y": 302.29010000000017,
"width": 81,
"height": 49,
"constants": {
"pin": "36",
"pullup": "None",
"debounce": 200
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": false
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "Parameter",
"name": "neo_status",
"id": "c02b1b9a-83a0-4dc8-6c78-b233f6794e97",
"ParameterType": "NeoPixel",
"datatype": "rgb",
"pid": 47403,
"x": 1303.4877000000001,
"y": 220.29010000000017,
"width": 73,
"height": 40,
"constants": {
"pin": "17",
"number_of_pixels": 1
},
"up_data": {
"can_go_up": true,
"type": "input",
"order": 999,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "hbt_led",
"id": "edadcf26-7123-6f65-aacc-531f07f49da0",
"ParameterType": "HbtLed",
"datatype": "int",
"pid": "55894",
"x": 1305.4877000000001,
"y": 145.12342824707048,
"width": 69,
"height": 34,
"constants": {
"pin": "15"
},
"up_data": {
"can_go_up": false,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "CANBus",
"id": "094dfcb9-7772-56e1-d37f-10f852b3fd3e",
"ParameterType": "CANBus",
"datatype": null,
"pid": 6545,
"x": 1297.9877000000001,
"y": 393.79010000000017,
"width": 84,
"height": 30,
"constants": {
"rx": "16",
"tx": "4",
"adr": "10",
"bus": "0",
"baud": 250000,
"rx_queue": 25
},
"up_data": {
"can_go_up": false,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "Zorg",
"id": "f85cbb04-153e-1a4e-ea47-e6bb46025721",
"ParameterType": "Zorg",
"datatype": null,
"pid": 21885,
"x": 1313.9877000000001,
"y": 467.1234129882814,
"width": 52,
"height": 23,
"up_data": {
"can_go_up": false,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "SDCard",
"id": "cfc75351-3637-fb86-57c3-348359952598",
"ParameterType": "SDCard",
"datatype": null,
"pid": 25805,
"x": 1382.9877000000001,
"y": 660.7544282470703,
"width": 85,
"height": 40,
"constants": {
"slot": "2",
"auto_mount": false
},
"up_data": {
"can_go_up": false,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "NotePad",
"id": "d62904e5-41be-2090-31f2-f67f776f676e",
"x": 1436.4877000000001,
"y": 102.62341298828142,
"width": 218,
"height": 25,
"ports": [],
"text": "Core Components"
},
{
"type": "Parameter",
"name": "button_a",
"id": "14ebbd38-779e-55a6-9269-cc6e5ee4d743",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 17754,
"x": 221.38830000000007,
"y": 437.68521298828125,
"width": 95,
"height": 95,
"constants": {
"pin": "34",
"pullup": "None",
"debounce": 200
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": true
},
"debug": true,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "button_b",
"id": "7dca15d9-7cf6-7d94-e192-93e98eaf7de8",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 12955,
"x": 221.38830000000007,
"y": 596.6852129882813,
"width": 95,
"height": 95,
"constants": {
"pin": "26",
"pullup": "pullup",
"debounce": 200
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "Parameter",
"name": "button_c",
"id": "4f5432db-959c-12f4-10ca-f832fb26d900",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 12806,
"x": 221.38830000000007,
"y": 749.6852129882813,
"width": 95,
"height": 95,
"constants": {
"pin": "14",
"pullup": "pullup",
"debounce": 200
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "Parameter",
"name": "button_d",
"id": "4284ad30-ea08-623b-3135-bee6999da0ee",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 4163,
"x": 221.38830000000007,
"y": 911.6852129882813,
"width": 95,
"height": 95,
"constants": {
"pin": "12",
"pullup": "pullup",
"debounce": 200
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "NotePad",
"id": "7dbfd6b8-29aa-4d1d-d477-c0a2ead80677",
"x": 226.38830000000007,
"y": 369.18521298828125,
"width": 218,
"height": 25,
"ports": [],
"text": "Buttons"
},
{
"type": "Parameter",
"name": "led_a",
"id": "cb264ac7-3366-a68b-6113-affe4c8a78b7",
"ParameterType": "DigitalOutput",
"datatype": "bool",
"pid": 5558,
"x": 577.3883000000001,
"y": 397.18521298828125,
"width": 95,
"height": 50,
"constants": {
"pin": "33"
},
"up_data": {
"can_go_up": true,
"type": "input",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "led_b",
"id": "d556e72c-29d2-c3bd-e1bb-e2b91932592a",
"ParameterType": "DigitalOutput",
"datatype": "bool",
"pid": 59323,
"x": 577.3883000000001,
"y": 528.6852129882813,
"width": 95,
"height": 50,
"constants": {
"pin": "25"
},
"up_data": {
"can_go_up": true,
"type": "input",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "led_c",
"id": "1902bc72-846a-8538-d8b1-2b20de140f62",
"ParameterType": "DigitalOutput",
"datatype": "bool",
"pid": 52957,
"x": 577.3883000000001,
"y": 641.6852129882813,
"width": 95,
"height": 50,
"constants": {
"pin": "21"
},
"up_data": {
"can_go_up": true,
"type": "input",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "led_d",
"id": "6fa0586f-bedc-3903-f464-9955478f3e98",
"ParameterType": "DigitalOutput",
"datatype": "bool",
"pid": 55135,
"x": 577.3883000000001,
"y": 762.6852129882813,
"width": 95,
"height": 50,
"constants": {
"pin": "22"
},
"up_data": {
"can_go_up": true,
"type": "input",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "NotePad",
"id": "7f7d78d6-8a01-ec57-63a8-c93af1d4d5ed",
"x": 596.8799667938233,
"y": 329.1852282470703,
"width": 218,
"height": 25,
"ports": [],
"text": "LEDs"
},
{
"type": "Parameter",
"name": "GuiCheckbox",
"id": "125303cf-d94b-827f-5663-aef3a944b449",
"ParameterType": "GuiCheckbox",
"datatype": "bool",
"pid": 59197,
"x": 261.5046000000001,
"y": 148.74381298828126,
"width": 123,
"height": 34,
"up_data": {
"can_go_up": true,
"type": "both",
"order": 999,
"up": false
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "Parameter",
"name": "WebsocketServer",
"id": "de4067b9-95a6-bba4-04e4-62917128ff98",
"ParameterType": "WebsocketServer",
"datatype": "null",
"pid": 43499,
"x": 1353.5,
"y": 536.1852129882813,
"width": 115,
"height": 35,
"up_data": {
"can_go_up": false,
"type": "output",
"order": 999,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "HoverConnection",
"id": "3f658083-625d-614a-c703-d4270120db8f",
"bus": "local",
"vertex": [
{
"x": 1381.9877000000001,
"y": 408.79010000000017
},
{
"x": 1479.4876999999997,
"y": 408.79010000000017
},
{
"x": 1479.4876999999997,
"y": 297.2662701311386
},
{
"x": 1567.9877000000001,
"y": 297.2662701311386
}
],
"source": {
"node": "094dfcb9-7772-56e1-d37f-10f852b3fd3e",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "bus"
}
},
{
"type": "HoverConnection",
"id": "65be2b61-ca8d-e5e3-81ff-af3dd48ce324",
"bus": "local",
"vertex": [
{
"x": 1378.9877000000001,
"y": 318.6234333333335
},
{
"x": 1456.9876999999997,
"y": 318.6234333333335
},
{
"x": 1456.9876999999997,
"y": 284.9805558454243
},
{
"x": 1567.9877000000001,
"y": 284.9805558454243
}
],
"source": {
"node": "755f08c5-a527-574e-94c4-ec22787d7c83",
"port": "event"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "function_button"
}
},
{
"type": "HoverConnection",
"id": "2b775f03-5aa3-3fe4-bb75-ac541beaf49c",
"bus": "local",
"vertex": [
{
"x": 1376.4877000000001,
"y": 246.95676666666682
},
{
"x": 1463.9876999999997,
"y": 246.95676666666682
},
{
"x": 1463.9876999999997,
"y": 272.69484155970997
},
{
"x": 1567.9877000000001,
"y": 272.69484155970997
}
],
"source": {
"node": "c02b1b9a-83a0-4dc8-6c78-b233f6794e97",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "neo_status"
}
},
{
"type": "HoverConnection",
"id": "a353554a-afc0-d5ca-7aff-b931e139d1d6",
"bus": "local",
"vertex": [
{
"x": 316.3883000000001,
"y": 943.3518796549479
},
{
"x": 460.88829999999996,
"y": 943.3518796549479
},
{
"x": 460.88829999999996,
"y": 775.1852129882813
},
{
"x": 577.3883000000001,
"y": 775.1852129882813
}
],
"source": {
"node": "4284ad30-ea08-623b-3135-bee6999da0ee",
"port": "event"
},
"target": {
"node": "6fa0586f-bedc-3903-f464-9955478f3e98",
"port": "input"
}
},
{
"type": "HoverConnection",
"id": "21bb159e-d995-026a-e02b-b6d1cfbcded0",
"bus": "local",
"vertex": [
{
"x": 384.5046000000001,
"y": 160.0771463216146
},
{
"x": 472.88829999999996,
"y": 160.0771463216146
},
{
"x": 472.88829999999996,
"y": 409.68521298828125
},
{
"x": 577.3883000000001,
"y": 409.68521298828125
}
],
"source": {
"node": "125303cf-d94b-827f-5663-aef3a944b449",
"port": "event"
},
"target": {
"node": "cb264ac7-3366-a68b-6113-affe4c8a78b7",
"port": "input"
}
},
{
"type": "HoverConnection",
"id": "ef0aba8e-2043-fd33-fb0f-4f0e89ec5744",
"bus": "local",
"vertex": [
{
"x": 1468.5,
"y": 553.6852129882813
},
{
"x": 1531.5,
"y": 553.6852129882813
},
{
"x": 1531.5,
"y": 321.83769870256714
},
{
"x": 1567.9877000000001,
"y": 321.83769870256714
}
],
"source": {
"node": "de4067b9-95a6-bba4-04e4-62917128ff98",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "webserver"
}
},
{
"type": "HoverConnection",
"id": "e95f2c63-3191-19d6-08c9-dbf3a3ea0c09",
"bus": "local",
"vertex": [
{
"x": 1365.9877000000001,
"y": 478.6234129882814
},
{
"x": 1508.4876999999997,
"y": 478.6234129882814
},
{
"x": 1508.4876999999997,
"y": 309.55198441685286
},
{
"x": 1567.9877000000001,
"y": 309.55198441685286
}
],
"source": {
"node": "f85cbb04-153e-1a4e-ea47-e6bb46025721",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "zorg"
}
},
{
"type": "HoverConnection",
"id": "dc40872d-41fc-2eda-e310-81e5e32ff6c5",
"bus": "local",
"vertex": [
{
"x": 316.3883000000001,
"y": 781.3518796549479
},
{
"x": 400.88829999999996,
"y": 781.3518796549479
},
{
"x": 400.88829999999996,
"y": 654.1852129882813
},
{
"x": 577.3883000000001,
"y": 654.1852129882813
}
],
"source": {
"node": "4f5432db-959c-12f4-10ca-f832fb26d900",
"port": "event"
},
"target": {
"node": "1902bc72-846a-8538-d8b1-2b20de140f62",
"port": "input"
}
},
{
"type": "HoverConnection",
"id": "81ccaff8-45df-2bae-17f8-729bdb4f03db",
"bus": "local",
"vertex": [
{
"x": 1374.4877000000001,
"y": 162.12342824707048
},
{
"x": 1488.9876999999997,
"y": 162.12342824707048
},
{
"x": 1488.9876999999997,
"y": 260.4091272739957
},
{
"x": 1567.9877000000001,
"y": 260.4091272739957
}
],
"source": {
"node": "edadcf26-7123-6f65-aacc-531f07f49da0",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "hbt_led"
}
}
]