mosfet_board

Last Modified: 2024-03-17 07:09:39

Created On: 2023-12-10 15:58:46

Owned By: evezor

Created By: anfro

Contributors: anfro, evezor

Public: True


Executable


        
# --------------------------------------
#   mosfet_board
#   65f697335e11676fcanv
__canvas_id__ = '65f697335e11676f'
# __version__ = TODO: add this
# --------------------------------------
from floe import FP

from NeoPixel import NeoPixel
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=16, bus=0, baud=250000, rx_queue=25, terminal_debug=False, debug=False, active=True, bcast=False, 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)
  DigitalOutput(name="output1", pid=34645, pin=19, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
  DigitalOutput(name="output2", pid=41646, pin=18, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
  DigitalOutput(name="output3", pid=56094, pin=25, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
  DigitalOutput(name="output4", pid=43505, pin=21, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
  DigitalOutput(name="output5", pid=51000, pin=22, invert=False, initial_value=False, datatype="bool", debug=False, active=True, bcast=False, iris=iris)
  DigitalOutput(name="output6", pid=17007, pin=23, 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="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:


["NeoPixel", "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": "65d352ad66a2829ecanv",
  "zorg": false,
  "busses": {
    "CANBus": "16"
  },
  "ports": [
    {
      "name": "output1",
      "reference_id": "96906580-3660-5cf8-b9b3-166f6e6ea5ca",
      "pid": 34645,
      "type": "input",
      "datatype": "bool",
      "parameter_type": "DigitalOutput"
    },
    {
      "name": "output2",
      "reference_id": "6fbbd229-fc4a-97f9-9c6f-97000dd02f35",
      "pid": 41646,
      "type": "input",
      "datatype": "bool",
      "parameter_type": "DigitalOutput"
    },
    {
      "name": "output3",
      "reference_id": "43362a2a-22f5-3d89-faf0-017c9d8a2d3a",
      "pid": 56094,
      "type": "input",
      "datatype": "bool",
      "parameter_type": "DigitalOutput"
    },
    {
      "name": "output4",
      "reference_id": "9168f000-faea-9edf-99db-601cf242d227",
      "pid": 43505,
      "type": "input",
      "datatype": "bool",
      "parameter_type": "DigitalOutput"
    },
    {
      "name": "output5",
      "reference_id": "fd65de75-46cc-c117-3db0-6953cd2161f9",
      "pid": 51000,
      "type": "input",
      "datatype": "bool",
      "parameter_type": "DigitalOutput"
    },
    {
      "name": "output6",
      "reference_id": "3dd33c80-09f6-17d8-6a3c-3c5c0e0b0a8f",
      "pid": 17007,
      "type": "input",
      "datatype": "bool",
      "parameter_type": "DigitalOutput"
    }
  ]
}
    

Uppie subs:


{}
    

Canvas code:


[
  {
    "type": "CanvasID",
    "id": "65f697335e11676fcanv",
    "x": 26.786299999999983,
    "y": 24.64382824707031,
    "selectable": false,
    "draggable": true,
    "text": "CanvasID: 65f697335e11676fcanv",
    "canvas_type": "core"
  },
  {
    "type": "Parameter",
    "name": "ESP32Core",
    "id": "9e65d461-88ea-d923-2508-c70738045031",
    "ParameterType": "ESP32Core",
    "datatype": null,
    "pid": "6074",
    "x": 1754.7108518622163,
    "y": 233.73128044604772,
    "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": 1467.7108518622163,
    "y": 219.0728804460477,
    "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": 1444.7108518622163,
    "y": 152.0728804460477,
    "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": 1496.7108518622163,
    "y": 321.97208044604776,
    "width": 79,
    "height": 43,
    "constants": {
      "rx": "16",
      "tx": "4",
      "adr": "16",
      "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": 1704.2108518622163,
    "y": 148.82408044604773,
    "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": 1433.3588518622164,
    "y": 67.79329343432896,
    "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": 1754.7108518622163,
    "y": 51.82408044604772,
    "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": "output1",
    "id": "96906580-3660-5cf8-b9b3-166f6e6ea5ca",
    "ParameterType": "DigitalOutput",
    "datatype": "bool",
    "pid": 34645,
    "x": 229.29035661711123,
    "y": 302.0439972676866,
    "width": 95,
    "height": 50,
    "constants": {
      "pin": "19"
    },
    "up_data": {
      "can_go_up": true,
      "type": "input",
      "order": 999,
      "up": true
    },
    "debug": false,
    "active": true,
    "broadcast": false
  },
  {
    "type": "Parameter",
    "name": "output2",
    "id": "6fbbd229-fc4a-97f9-9c6f-97000dd02f35",
    "ParameterType": "DigitalOutput",
    "datatype": "bool",
    "pid": 41646,
    "x": 229.29035661711123,
    "y": 444.94558427940535,
    "width": 95,
    "height": 50,
    "constants": {
      "pin": "18"
    },
    "up_data": {
      "can_go_up": true,
      "type": "input",
      "order": 999,
      "up": true
    },
    "debug": false,
    "active": true,
    "broadcast": false
  },
  {
    "type": "Parameter",
    "name": "output3",
    "id": "43362a2a-22f5-3d89-faf0-017c9d8a2d3a",
    "ParameterType": "DigitalOutput",
    "datatype": "bool",
    "pid": 56094,
    "x": 229.29035661711123,
    "y": 576.4599972676866,
    "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": "output4",
    "id": "9168f000-faea-9edf-99db-601cf242d227",
    "ParameterType": "DigitalOutput",
    "datatype": "bool",
    "pid": 43505,
    "x": 526.8551587546034,
    "y": 302.0439972676866,
    "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": "output5",
    "id": "fd65de75-46cc-c117-3db0-6953cd2161f9",
    "ParameterType": "DigitalOutput",
    "datatype": "bool",
    "pid": 51000,
    "x": 526.8551587546034,
    "y": 444.94558427940535,
    "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": "output6",
    "id": "3dd33c80-09f6-17d8-6a3c-3c5c0e0b0a8f",
    "ParameterType": "DigitalOutput",
    "datatype": "bool",
    "pid": 17007,
    "x": 532.9700766671526,
    "y": 576.4599972676866,
    "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": "NotePad",
    "id": "12a3c684-2aa7-8de8-c4d8-261a927095ac",
    "x": 346.3833312988281,
    "y": 209.84999084472656,
    "width": 215.23333740234375,
    "height": 25,
    "ports": [],
    "text": "Mosfet Outputs"
  },
  {
    "type": "NotePad",
    "id": "425a720f-c5e7-ff12-2b19-e5758cd799ad",
    "x": 325.35000228881836,
    "y": 713.8500061035156,
    "width": 215.23333740234375,
    "height": 25,
    "ports": [],
    "text": "Outputs Bus Voltage"
  },
  {
    "type": "HoverConnection",
    "id": "825c8068-d774-af1f-4d9a-32a158ca9744",
    "bus": "local",
    "vertex": [
      {
        "x": 1507.3588518622164,
        "y": 87.79329343432896
      },
      {
        "x": 1679.7108518622163,
        "y": 87.79329343432896
      },
      {
        "x": 1679.7108518622163,
        "y": 257.15985187461916
      },
      {
        "x": 1754.7108518622163,
        "y": 257.15985187461916
      }
    ],
    "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": 1562.7108518622163,
        "y": 236.0728804460477
      },
      {
        "x": 1642.7108518622163,
        "y": 236.0728804460477
      },
      {
        "x": 1642.7108518622163,
        "y": 304.016994731762
      },
      {
        "x": 1754.7108518622163,
        "y": 304.016994731762
      }
    ],
    "source": {
      "node": "755f08c5-a527-574e-94c4-ec22787d7c83",
      "port": "event"
    },
    "target": {
      "node": "9e65d461-88ea-d923-2508-c70738045031",
      "port": "function_button"
    }
  },
  {
    "type": "HoverConnection",
    "id": "3f658083-625d-614a-c703-d4270120db8f",
    "bus": "local",
    "vertex": [
      {
        "x": 1575.7108518622163,
        "y": 343.47208044604776
      },
      {
        "x": 1645.2108518622163,
        "y": 343.47208044604776
      },
      {
        "x": 1645.2108518622163,
        "y": 327.44556616033344
      },
      {
        "x": 1754.7108518622163,
        "y": 327.44556616033344
      }
    ],
    "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": 1517.7108518622163,
        "y": 178.73954711271435
      },
      {
        "x": 1661.7108518622163,
        "y": 178.73954711271435
      },
      {
        "x": 1661.7108518622163,
        "y": 280.58842330319055
      },
      {
        "x": 1754.7108518622163,
        "y": 280.58842330319055
      }
    ],
    "source": {
      "node": "c02b1b9a-83a0-4dc8-6c78-b233f6794e97",
      "port": "self"
    },
    "target": {
      "node": "9e65d461-88ea-d923-2508-c70738045031",
      "port": "neo_status"
    }
  }
]