Browse Source

added power controller for the feeder

asobolev 1 year ago
parent
commit
0258e0d0dc
1 changed files with 8 additions and 3 deletions
  1. 8 3
      controllers/serial.ipynb

+ 8 - 3
controllers/serial.ipynb

@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 1,
+   "execution_count": 2,
    "id": "82162890",
    "metadata": {},
    "outputs": [],
@@ -14,7 +14,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
+   "execution_count": 3,
    "id": "2fc2905a",
    "metadata": {},
    "outputs": [],
@@ -48,7 +48,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": 4,
    "id": "fe78b7d4",
    "metadata": {},
    "outputs": [],
@@ -59,6 +59,7 @@
     "    pin_TTL_2 = 5\n",
     "    pin_LED_lights = 7\n",
     "    pin_feeder = 8\n",
+    "    pin_feeder_power = 4\n",
     "    \n",
     "    def __init__(self, *args, **kwargs):\n",
     "        self.last_cmd = False  # False - Arduino LOW, True - Arduino HIGH\n",
@@ -76,9 +77,13 @@
     "        self.digital[MCSArduino.pin_LED_lights].write(self.is_light_off)\n",
     "        \n",
     "    def feed(self):\n",
+    "        self.digital[MCSArduino.pin_feeder_power].write(True)\n",
+    "        time.sleep(0.5)\n",
     "        self.digital[MCSArduino.pin_feeder].write(True)\n",
     "        time.sleep(0.02)\n",
     "        self.digital[MCSArduino.pin_feeder].write(False)\n",
+    "        time.sleep(1.5)\n",
+    "        self.digital[MCSArduino.pin_feeder_power].write(False)\n",
     "        \n",
     "        \n",
     "class FakeArduino():\n",