neo_strip_board
Last Modified: 2024-04-09 08:31:32
Created On: 2023-12-10 15:58:46
Owned By: evezor
Created By: anfro
Contributors: anfro, evezor
Public: True
Executable
# --------------------------------------
# neo_strip_board
# 65f6973f75482943canv
__canvas_id__ = '65f6973f75482943'
# __version__ = TODO: add this
# --------------------------------------
from floe import FP
from NeoPixel import NeoPixel
from ColorChase import ColorChase
from ESP32Core import ESP32Core
from HbtLed import HbtLed
from Rainbow import Rainbow
from CANBus import CANBus
from DigitalInput import DigitalInput
from Variable import Variable
from DigitalOutput import DigitalOutput
def setup(iris):
CANBus(name='CANBus', pid=6545, rx=16, tx=4, adr=29, bus=0, baud=250000, rx_queue=25, terminal_debug=False, debug=False, active=True, bcast=False, iris=iris)
ColorChase(name='ColorChase', pid=25758, dot_color=None, fill_color=None, datatype="rgb", debug=False, active=True, bcast=False, iris=iris)
DigitalInput(name='a', pid=29989, pin=21, pullup='pullup', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name='b', pid=39132, pin=19, pullup='pullup', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name='c', pid=10879, pin=15, 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='can_slp', pid=11397, pin=2, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
ESP32Core(name='ESP32Core', pid=6074, wifi=False, hbt_led=FP(50487), neo_status=FP(47403), function_button=FP(2276), bus=FP(6545), zorg=None, webserver=None, debug=False, active=True, bcast=False, iris=iris)
HbtLed(name='HbtLed', pid=50487, pin=5, delay=1000, datatype="int", debug=False, active=True, bcast=False, iris=iris)
NeoPixel(name='neo1', pid=46829, pin=23, number_of_pixels=1, animation=FP(52598), delay=FP(57376), animations=[FP(25758), FP(29444)], datatype="rgb", debug=False, active=True, bcast=False, iris=iris)
NeoPixel(name='neo2', pid=51338, pin=22, number_of_pixels=1, animation=FP(52598), delay=FP(57376), animations=[FP(25758), FP(29444)], datatype="rgb", 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)
Rainbow(name='Rainbow', pid=29444, datatype="rgb", debug=False, active=True, bcast=False, iris=iris)
Variable(name='animation', pid=52598, state=0, datatype="int", constant=False, debug=False, active=True, bcast=True, iris=iris)
Variable(name='delay', pid=57376, state=200, datatype="int", constant=False, debug=False, active=True, bcast=True, iris=iris)
iris.add_hots({})
Canvas View:
Dependencies:
["NeoPixel", "ColorChase", "ESP32Core", "HbtLed", "Parameter", "FileReceiver", "Rainbow", "CANBus", "DigitalInput", "Variable", "DigitalOutput"]
Uppie code:
this code is used as the constructor in this canvas is dropped on a canvas above
{
"canvas_id": "65f6973f75482943canv",
"zorg": false,
"busses": {
"CANBus": "29"
},
"ports": [
{
"name": "a",
"reference_id": "4ccb6a31-495e-fb36-3826-ca1c061c4da8",
"pid": 29989,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "b",
"reference_id": "c62362b7-c36a-20e3-9ca3-ef14d8de772b",
"pid": 39132,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "c",
"reference_id": "703080b8-387a-a806-2b5d-cb80328856c3",
"pid": 10879,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "delay",
"reference_id": "f5663ace-e4cc-4fde-6551-4294be98ea9a",
"pid": 57376,
"type": "both",
"datatype": "int",
"parameter_type": "Variable"
},
{
"name": "animation",
"reference_id": "820c3cc4-b022-a768-0b1d-f9bddde7df83",
"pid": 52598,
"type": "both",
"datatype": "int",
"parameter_type": "Variable"
}
]
}
Uppie subs:
{}
Canvas code:
[
{
"type": "CanvasID",
"id": "65f6973f75482943canv",
"x": 26.786299999999983,
"y": 24.64382824707031,
"selectable": false,
"draggable": true,
"text": "",
"canvas_type": "core"
},
{
"type": "Parameter",
"name": "ESP32Core",
"id": "9e65d461-88ea-d923-2508-c70738045031",
"ParameterType": "ESP32Core",
"datatype": null,
"pid": "6074",
"x": 2417.9577,
"y": 272.2713,
"width": 95,
"height": 164,
"constants": {
"wifi": false
},
"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": 2130.9577,
"y": 257.61289999999997,
"width": 95,
"height": 51,
"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": 2107.9577,
"y": 190.61289999999997,
"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": "CANBus",
"id": "094dfcb9-7772-56e1-d37f-10f852b3fd3e",
"ParameterType": "CANBus",
"datatype": null,
"pid": 6545,
"x": 2159.9577,
"y": 360.51210000000003,
"width": 79,
"height": 43,
"constants": {
"rx": "16",
"tx": "4",
"adr": "29",
"bus": "0",
"baud": 250000,
"rx_queue": 25
},
"up_data": {
"can_go_up": false,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "NotePad",
"id": "d62904e5-41be-2090-31f2-f67f776f676e",
"x": 2367.4577,
"y": 187.3641,
"width": 218,
"height": 25,
"ports": [],
"text": "Core Components"
},
{
"type": "Parameter",
"name": "HbtLed",
"id": "7906fc95-7e4b-9ed1-dab9-abd07d17d0c2",
"ParameterType": "HbtLed",
"datatype": "int",
"pid": 50487,
"x": 2096.6057,
"y": 106.33331298828125,
"width": 74,
"height": 40,
"constants": {
"pin": "5"
},
"up_data": {
"can_go_up": false,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "can_slp",
"id": "3a429d50-899d-cb28-be24-195f5663a9ee",
"ParameterType": "DigitalOutput",
"datatype": "bool",
"pid": 11397,
"x": 2417.9577,
"y": 90.36410000000001,
"width": 95,
"height": 50,
"constants": {
"pin": "2"
},
"up_data": {
"can_go_up": true,
"type": "input",
"order": 999,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "a",
"id": "4ccb6a31-495e-fb36-3826-ca1c061c4da8",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 29989,
"x": 324.5,
"y": 248.83331298828125,
"width": 90,
"height": 45,
"constants": {
"pin": "21",
"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": "b",
"id": "c62362b7-c36a-20e3-9ca3-ef14d8de772b",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 39132,
"x": 324.5,
"y": 392.51210000000003,
"width": 90,
"height": 45,
"constants": {
"pin": "19",
"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": "c",
"id": "703080b8-387a-a806-2b5d-cb80328856c3",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 10879,
"x": 324.5,
"y": 531.5265129882813,
"width": 90,
"height": 45,
"constants": {
"pin": "15",
"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": "neo1",
"id": "e7c62e6e-b3d5-cc37-c538-0cfefed12152",
"ParameterType": "NeoPixel",
"datatype": "rgb",
"pid": 46829,
"x": 1147.5,
"y": 412.3641,
"width": 85,
"height": 40,
"constants": {
"pin": "23",
"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": "neo2",
"id": "bae8c7b2-1f35-7134-8ad8-da972a2cce05",
"ParameterType": "NeoPixel",
"datatype": "rgb",
"pid": 51338,
"x": 1147.5,
"y": 637.8333129882812,
"width": 85,
"height": 40,
"constants": {
"pin": "22",
"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": "Rainbow",
"id": "b3111c19-435d-01be-77a4-cefc49f21b51",
"ParameterType": "Rainbow",
"datatype": "rgb",
"pid": 29444,
"x": 805.655,
"y": 664.7701,
"width": 85,
"height": 40,
"up_data": {
"can_go_up": false,
"type": "input",
"order": 999,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "ColorChase",
"id": "ee09d9f6-9959-e49c-e902-fab2a924a4ef",
"ParameterType": "ColorChase",
"datatype": "rgb",
"pid": 25758,
"x": 805.655,
"y": 766.0913129882813,
"width": 85,
"height": 40,
"up_data": {
"can_go_up": false,
"type": "input",
"order": 999,
"up": false
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Variable",
"id": "f5663ace-e4cc-4fde-6551-4294be98ea9a",
"name": "delay",
"class": "Int",
"datatype": "int",
"state": "200",
"pid": 57376,
"up_data": {
"type": "both",
"order": 999,
"up": true
},
"constant": false,
"x": 889.5,
"y": 362.8333282470703,
"width": 53,
"height": 36,
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "Variable",
"id": "820c3cc4-b022-a768-0b1d-f9bddde7df83",
"name": "animation",
"class": "Int",
"datatype": "int",
"state": "0",
"pid": 52598,
"up_data": {
"type": "both",
"order": 999,
"up": true
},
"constant": false,
"x": 895.5,
"y": 261.83331298828125,
"width": 41,
"height": 32,
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "NotePad",
"id": "d670df26-810d-29b5-3998-4b162120166e",
"x": 332.9750003814697,
"y": 162.8333282470703,
"width": 218,
"height": 25,
"ports": [],
"text": "Buttons"
},
{
"type": "HoverConnection",
"id": "a08de053-b41b-7e1f-f051-85c32bc41059",
"bus": "local",
"vertex": [
{
"x": 936.5,
"y": 277.83331298828125
},
{
"x": 1066.5,
"y": 277.83331298828125
},
{
"x": 1066.5,
"y": 428.3641
},
{
"x": 1147.5,
"y": 428.3641
}
],
"source": {
"node": "820c3cc4-b022-a768-0b1d-f9bddde7df83",
"port": "output0"
},
"target": {
"node": "e7c62e6e-b3d5-cc37-c538-0cfefed12152",
"port": "animation"
}
},
{
"type": "HoverConnection",
"id": "322e103f-3b78-903c-7f31-10809ca4482f",
"bus": "local",
"vertex": [
{
"x": 942.5,
"y": 380.8333282470703
},
{
"x": 1056.9304,
"y": 380.8333282470703
},
{
"x": 1056.9304,
"y": 436.3641
},
{
"x": 1147.5,
"y": 436.3641
}
],
"source": {
"node": "f5663ace-e4cc-4fde-6551-4294be98ea9a",
"port": "output0"
},
"target": {
"node": "e7c62e6e-b3d5-cc37-c538-0cfefed12152",
"port": "delay"
}
},
{
"type": "HoverConnection",
"id": "c4317b86-4d51-1ffa-7b73-0ee07fdd4f2f",
"bus": "local",
"vertex": [
{
"x": 890.655,
"y": 786.0913129882813
},
{
"x": 1051.9335,
"y": 786.0913129882813
},
{
"x": 1051.9335,
"y": 669.8333129882812
},
{
"x": 1147.5,
"y": 669.8333129882812
}
],
"source": {
"node": "ee09d9f6-9959-e49c-e902-fab2a924a4ef",
"port": "self"
},
"target": {
"node": "bae8c7b2-1f35-7134-8ad8-da972a2cce05",
"port": "animations"
}
},
{
"type": "HoverConnection",
"id": "b60b778f-046c-5d44-315a-74ce6b68444a",
"bus": "local",
"vertex": [
{
"x": 890.655,
"y": 684.7701
},
{
"x": 1032.7674999999995,
"y": 684.7701
},
{
"x": 1032.7674999999995,
"y": 669.8333129882812
},
{
"x": 1147.5,
"y": 669.8333129882812
}
],
"source": {
"node": "b3111c19-435d-01be-77a4-cefc49f21b51",
"port": "self"
},
"target": {
"node": "bae8c7b2-1f35-7134-8ad8-da972a2cce05",
"port": "animations"
}
},
{
"type": "HoverConnection",
"id": "9cb4b88b-c812-18aa-df32-63cbaae619af",
"bus": "local",
"vertex": [
{
"x": 936.5,
"y": 277.83331298828125
},
{
"x": 1045.5721000000003,
"y": 277.83331298828125
},
{
"x": 1045.5721000000003,
"y": 653.8333129882812
},
{
"x": 1147.5,
"y": 653.8333129882812
}
],
"source": {
"node": "820c3cc4-b022-a768-0b1d-f9bddde7df83",
"port": "output0"
},
"target": {
"node": "bae8c7b2-1f35-7134-8ad8-da972a2cce05",
"port": "animation"
}
},
{
"type": "HoverConnection",
"id": "d60ef6a4-efb3-afa8-3761-6387d3204931",
"bus": "local",
"vertex": [
{
"x": 942.5,
"y": 380.8333282470703
},
{
"x": 1032,
"y": 380.8333282470703
},
{
"x": 1032,
"y": 661.8333129882812
},
{
"x": 1147.5,
"y": 661.8333129882812
}
],
"source": {
"node": "f5663ace-e4cc-4fde-6551-4294be98ea9a",
"port": "output0"
},
"target": {
"node": "bae8c7b2-1f35-7134-8ad8-da972a2cce05",
"port": "delay"
}
},
{
"type": "HoverConnection",
"id": "a8e9d76b-9545-bccb-2b0f-e2656913cc8a",
"bus": "local",
"vertex": [
{
"x": 890.655,
"y": 786.0913129882813
},
{
"x": 1018.5630999999994,
"y": 786.0913129882813
},
{
"x": 1018.5630999999994,
"y": 444.3641
},
{
"x": 1147.5,
"y": 444.3641
}
],
"source": {
"node": "ee09d9f6-9959-e49c-e902-fab2a924a4ef",
"port": "self"
},
"target": {
"node": "e7c62e6e-b3d5-cc37-c538-0cfefed12152",
"port": "animations"
}
},
{
"type": "HoverConnection",
"id": "95cb7a0d-660c-1f56-292a-61e488a339b9",
"bus": "local",
"vertex": [
{
"x": 890.655,
"y": 684.7701
},
{
"x": 1005.5265999999997,
"y": 684.7701
},
{
"x": 1005.5265999999997,
"y": 444.3641
},
{
"x": 1147.5,
"y": 444.3641
}
],
"source": {
"node": "b3111c19-435d-01be-77a4-cefc49f21b51",
"port": "self"
},
"target": {
"node": "e7c62e6e-b3d5-cc37-c538-0cfefed12152",
"port": "animations"
}
},
{
"type": "HoverConnection",
"id": "2b775f03-5aa3-3fe4-bb75-ac541beaf49c",
"bus": "local",
"vertex": [
{
"x": 2180.9577,
"y": 217.27956666666662
},
{
"x": 2324.9577,
"y": 217.27956666666662
},
{
"x": 2324.9577,
"y": 319.12844285714283
},
{
"x": 2417.9577,
"y": 319.12844285714283
}
],
"source": {
"node": "c02b1b9a-83a0-4dc8-6c78-b233f6794e97",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "neo_status"
}
},
{
"type": "HoverConnection",
"id": "3f658083-625d-614a-c703-d4270120db8f",
"bus": "local",
"vertex": [
{
"x": 2238.9577,
"y": 382.01210000000003
},
{
"x": 2308.4577,
"y": 382.01210000000003
},
{
"x": 2308.4577,
"y": 365.9855857142857
},
{
"x": 2417.9577,
"y": 365.9855857142857
}
],
"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": 2225.9577,
"y": 274.61289999999997
},
{
"x": 2305.9577,
"y": 274.61289999999997
},
{
"x": 2305.9577,
"y": 342.5570142857143
},
{
"x": 2417.9577,
"y": 342.5570142857143
}
],
"source": {
"node": "755f08c5-a527-574e-94c4-ec22787d7c83",
"port": "event"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "function_button"
}
},
{
"type": "HoverConnection",
"id": "825c8068-d774-af1f-4d9a-32a158ca9744",
"bus": "local",
"vertex": [
{
"x": 2170.6057,
"y": 126.33331298828125
},
{
"x": 2342.9577,
"y": 126.33331298828125
},
{
"x": 2342.9577,
"y": 295.69987142857144
},
{
"x": 2417.9577,
"y": 295.69987142857144
}
],
"source": {
"node": "7906fc95-7e4b-9ed1-dab9-abd07d17d0c2",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "hbt_led"
}
}
]