max6675_board
Last Modified: 2024-03-17 07:09:48
Created On: 2023-12-10 15:58:46
Owned By: evezor
Created By: anfro
Contributors: anfro, evezor
Public: True
Executable
# --------------------------------------
# max6675_board
# 65f6973cf6b5457dcanv
__canvas_id__ = '65f6973cf6b5457d'
# __version__ = TODO: add this
# --------------------------------------
from floe import FP
from NeoPixel import NeoPixel
from Max6675 import Max6675
from DigitalOutput import DigitalOutput
from DigitalInput import DigitalInput
from HbtLed import HbtLed
from ESP32Core import ESP32Core
from CANBus import CANBus
def setup(iris):
CANBus(name="CANBus", pid=6545, rx=16, tx=4, adr=23, bus=0, baud=250000, rx_queue=25, terminal_debug=False, debug=False, active=True, bcast=False, iris=iris)
DigitalInput(name="a", pid=12156, pin=25, pullup='pullup', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name="b", pid=52824, pin=26, pullup='pullup', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name="c", pid=38281, 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)
DigitalInput(name="input1", pid=46295, pin=32, pullup='None', debounce=200, invert=True, initial_value=False, datatype="bool", debug=False, active=True, bcast=True, iris=iris)
DigitalInput(name="input2", pid=15730, pin=33, 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)
DigitalOutput(name="fet1", pid=22942, pin=23, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
DigitalOutput(name="fet2", pid=31125, pin=22, 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)
Max6675(name="Max6675", pid=26458, sck_pin=18, cs_pin=21, so_pin=19, celsius=True, delay=250, datatype="float32", debug=False, active=True, bcast=True, 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)
iris.add_hots({})
Canvas View:
Dependencies:
["I2C", "NeoPixel", "Max6675", "DigitalOutput", "DigitalInput", "HbtLed", "Parameter", "FileReceiver", "ESP32Core", "CANBus"]
Uppie code:
this code is used as the constructor in this canvas is dropped on a canvas above
{
"canvas_id": "65d4bcd79e2322c6canv",
"zorg": false,
"busses": {
"CANBus": "23"
},
"ports": [
{
"name": "a",
"reference_id": "50d58f6b-d694-8d2e-f93b-692b3768a751",
"pid": 12156,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "b",
"reference_id": "6320fd17-48a0-fd36-66ee-46fe1581f8df",
"pid": 52824,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "c",
"reference_id": "556ec6cf-9e30-a4d8-0b1f-c7c9cb48635a",
"pid": 38281,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "input1",
"reference_id": "55799693-939e-2bef-9232-668db2e3d7bb",
"pid": 46295,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "input2",
"reference_id": "5c4b7be0-4ec8-2f7a-b4ad-759e81e26799",
"pid": 15730,
"type": "output",
"datatype": "bool",
"parameter_type": "DigitalInput"
},
{
"name": "fet1",
"reference_id": "a38858fa-f4ec-6ca1-40f0-8b9aa01150ba",
"pid": 22942,
"type": "input",
"datatype": "bool",
"parameter_type": "DigitalOutput"
},
{
"name": "fet2",
"reference_id": "12d4bd58-4a85-fdbd-0ff4-2dd4de4cdfe8",
"pid": 31125,
"type": "input",
"datatype": "bool",
"parameter_type": "DigitalOutput"
},
{
"name": "Max6675",
"reference_id": "31a3cb65-6873-9cef-e9e8-d531d90488c6",
"pid": 26458,
"type": "output",
"datatype": "float32",
"parameter_type": "Max6675"
}
]
}
Uppie subs:
{}
Canvas code:
[
{
"type": "CanvasID",
"id": "65f6973cf6b5457dcanv",
"x": 26.786299999999983,
"y": 24.64382824707031,
"selectable": false,
"draggable": true,
"text": "CanvasID: 65f6973cf6b5457dcanv",
"canvas_type": "core"
},
{
"type": "Parameter",
"name": "ESP32Core",
"id": "9e65d461-88ea-d923-2508-c70738045031",
"ParameterType": "ESP32Core",
"datatype": null,
"pid": "6074",
"x": 1869.3853,
"y": 304.9602,
"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": 1582.3853,
"y": 290.30179999999996,
"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": 1559.3853,
"y": 223.30179999999996,
"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": 1611.3853,
"y": 393.201,
"width": 79,
"height": 43,
"constants": {
"rx": "16",
"tx": "4",
"adr": "23",
"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": 1832.940868701172,
"y": 231.30179999999996,
"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": 1548.0333,
"y": 139.02221298828124,
"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": 1896.0742,
"y": 139.02221298828124,
"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": "50d58f6b-d694-8d2e-f93b-692b3768a751",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 12156,
"x": 143.4662179718017,
"y": 438.6904129882812,
"width": 90,
"height": 45,
"constants": {
"pin": "25",
"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": "45f1c230-3787-6632-4d97-7f37fd9910b7",
"x": 367.52601835327147,
"y": 371.13890903015135,
"width": 192,
"height": 25,
"ports": [],
"text": "Buttons"
},
{
"type": "Parameter",
"name": "b",
"id": "6320fd17-48a0-fd36-66ee-46fe1581f8df",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 52824,
"x": 375.992017590332,
"y": 438.6904129882812,
"width": 90,
"height": 45,
"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": "c",
"id": "556ec6cf-9e30-a4d8-0b1f-c7c9cb48635a",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 38281,
"x": 616.0267717773438,
"y": 438.6904129882812,
"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": "input1",
"id": "55799693-939e-2bef-9232-668db2e3d7bb",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 46295,
"x": 175.5878179718017,
"y": 182.5226,
"width": 90,
"height": 45,
"constants": {
"pin": "32",
"pullup": "None",
"debounce": 200
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "Parameter",
"name": "input2",
"id": "5c4b7be0-4ec8-2f7a-b4ad-759e81e26799",
"ParameterType": "DigitalInput",
"datatype": "bool",
"pid": 15730,
"x": 426.6523717773439,
"y": 182.5226,
"width": 90,
"height": 45,
"constants": {
"pin": "33",
"pullup": "None",
"debounce": 200
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "Parameter",
"name": "fet1",
"id": "a38858fa-f4ec-6ca1-40f0-8b9aa01150ba",
"ParameterType": "DigitalOutput",
"datatype": "bool",
"pid": 22942,
"x": 208.26861797180175,
"y": 714.2297213867188,
"width": 95,
"height": 50,
"constants": {
"pin": "23"
},
"up_data": {
"can_go_up": true,
"type": "input",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": false
},
{
"type": "Parameter",
"name": "fet2",
"id": "12d4bd58-4a85-fdbd-0ff4-2dd4de4cdfe8",
"ParameterType": "DigitalOutput",
"datatype": "bool",
"pid": 31125,
"x": 466.992017590332,
"y": 714.2297213867188,
"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": "Parameter",
"name": "Max6675",
"id": "31a3cb65-6873-9cef-e9e8-d531d90488c6",
"ParameterType": "Max6675",
"datatype": "float32",
"pid": 26458,
"x": 841.6427717773438,
"y": 227.35180019073482,
"width": 75,
"height": 40,
"constants": {
"sck_pin": "18",
"cs_pin": "21",
"so_pin": "19"
},
"up_data": {
"can_go_up": true,
"type": "output",
"order": 999,
"up": true
},
"debug": false,
"active": true,
"broadcast": true
},
{
"type": "NotePad",
"id": "9a1c3acf-235d-9e7f-b1cb-3ab5749c7c6d",
"x": 293.95786842041014,
"y": 635.6182221679688,
"width": 210.98789978027344,
"height": 35.66666793823242,
"ports": [],
"text": "Mosfet Outputs\nOutputs bus voltage"
},
{
"type": "NotePad",
"id": "fb116c3a-09d9-e8fe-459f-7c31f1995bc6",
"x": 285.04757177734376,
"y": 113.55423742675782,
"width": 210.98789978027344,
"height": 25,
"ports": [],
"text": "Digital Inputs"
},
{
"type": "NotePad",
"id": "c51ab4f1-4d6d-e3d3-18bc-faa8c4a6da3c",
"x": 811.7003717773439,
"y": 157.37963104858397,
"width": 210.98789978027344,
"height": 25,
"ports": [],
"text": "Thermocouple"
},
{
"type": "HoverConnection",
"id": "3f658083-625d-614a-c703-d4270120db8f",
"bus": "local",
"vertex": [
{
"x": 1690.3853,
"y": 414.701
},
{
"x": 1759.8853,
"y": 414.701
},
{
"x": 1759.8853,
"y": 398.6744857142857
},
{
"x": 1869.3853,
"y": 398.6744857142857
}
],
"source": {
"node": "094dfcb9-7772-56e1-d37f-10f852b3fd3e",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "bus"
}
},
{
"type": "HoverConnection",
"id": "2b775f03-5aa3-3fe4-bb75-ac541beaf49c",
"bus": "local",
"vertex": [
{
"x": 1632.3853,
"y": 249.96846666666661
},
{
"x": 1776.3853,
"y": 249.96846666666661
},
{
"x": 1776.3853,
"y": 351.8173428571428
},
{
"x": 1869.3853,
"y": 351.8173428571428
}
],
"source": {
"node": "c02b1b9a-83a0-4dc8-6c78-b233f6794e97",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "neo_status"
}
},
{
"type": "HoverConnection",
"id": "825c8068-d774-af1f-4d9a-32a158ca9744",
"bus": "local",
"vertex": [
{
"x": 1622.0333,
"y": 159.02221298828124
},
{
"x": 1794.3853,
"y": 159.02221298828124
},
{
"x": 1794.3853,
"y": 328.38877142857143
},
{
"x": 1869.3853,
"y": 328.38877142857143
}
],
"source": {
"node": "7906fc95-7e4b-9ed1-dab9-abd07d17d0c2",
"port": "self"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "hbt_led"
}
},
{
"type": "HoverConnection",
"id": "65be2b61-ca8d-e5e3-81ff-af3dd48ce324",
"bus": "local",
"vertex": [
{
"x": 1677.3853,
"y": 307.30179999999996
},
{
"x": 1757.3853,
"y": 307.30179999999996
},
{
"x": 1757.3853,
"y": 375.24591428571426
},
{
"x": 1869.3853,
"y": 375.24591428571426
}
],
"source": {
"node": "755f08c5-a527-574e-94c4-ec22787d7c83",
"port": "event"
},
"target": {
"node": "9e65d461-88ea-d923-2508-c70738045031",
"port": "function_button"
}
}
]