aggiunte cose

This commit is contained in:
2020-11-30 13:27:54 +00:00
parent cdb4aced3e
commit fd00ff3d87
3 changed files with 95 additions and 2 deletions

37
poetry.lock generated
View File

@@ -1,3 +1,30 @@
[[package]]
name = "colorzero"
version = "1.1"
description = "Yet another Python color library."
category = "main"
optional = false
python-versions = "*"
[package.extras]
doc = ["sphinx"]
test = ["pytest", "coverage", "mock"]
[[package]]
name = "gpiozero"
version = "1.5.1"
description = "A simple interface to GPIO devices with Raspberry Pi."
category = "main"
optional = false
python-versions = "*"
[package.dependencies]
colorzero = "*"
[package.extras]
doc = ["sphinx"]
test = ["pytest", "coverage", "mock"]
[[package]] [[package]]
name = "paho-mqtt" name = "paho-mqtt"
version = "1.5.1" version = "1.5.1"
@@ -20,9 +47,17 @@ python-versions = "*"
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.8" python-versions = "^3.8"
content-hash = "01386c0a415f38d4252a3e911925343c3bafeb207dc5a67bffcb23d5da48971e" content-hash = "df2668ebf88abf7c1bbed90df65d5c54a84ccbafda357d81082b15c32a67ebf9"
[metadata.files] [metadata.files]
colorzero = [
{file = "colorzero-1.1-py2.py3-none-any.whl", hash = "sha256:e3c36d15b293de2b2f77ff54a5bd243fffac941ed0a5332d0697a6612a26a0a3"},
{file = "colorzero-1.1.tar.gz", hash = "sha256:acba47119b5d8555680d3cda9afe6ccc5481385ccc3c00084dd973f7aa184599"},
]
gpiozero = [
{file = "gpiozero-1.5.1-py2.py3-none-any.whl", hash = "sha256:101044038e71cec8be2fa841d4cea9e50e7962e9fb0287f465298b59e3f06594"},
{file = "gpiozero-1.5.1.tar.gz", hash = "sha256:ae1a8dc4e6e793ffd8f900968f3290d218052c46347fa0c0503c65fabe422e4d"},
]
paho-mqtt = [ paho-mqtt = [
{file = "paho-mqtt-1.5.1.tar.gz", hash = "sha256:9feb068e822be7b3a116324e01fb6028eb1d66412bf98595ae72698965cb1cae"}, {file = "paho-mqtt-1.5.1.tar.gz", hash = "sha256:9feb068e822be7b3a116324e01fb6028eb1d66412bf98595ae72698965cb1cae"},
] ]

View File

@@ -1 +1,57 @@
print("Hello world") from gpiozero import Button
from paho.mqtt import client as mqtt
from signal import pause
import sys
#numero pin GPIO secondo lo schema BCM
SU =1
GIU =2
SX =3
DX =4
OK =5
CAN =6
#variabili globali
isRunning = True
def send_SU():
pass
def send_GIU():
pass
def send_SX():
pass
def send_DX():
pass
def send_OK():
pass
def send_CAN():
pass
def main():
btn_su = Button(SU)
btn_giu = Button(GIU)
btn_sx = Button(SX)
btn_dx = Button(DX)
btn_ok = Button(OK)
btn_can = Button(CAN)
while isRunning:
try:
client = mqtt.Client()
client.connect('localhost',1883)
except Exception as e:
print(f"Exception: {e}")
pass
pass
if __name__=="__main__":
sys.exit(main())

View File

@@ -7,6 +7,8 @@ authors = ["Emanuele <ema.trabattoni@gmail.com>"]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.8" python = "^3.8"
paho-mqtt = "^1.5.1" paho-mqtt = "^1.5.1"
"RPi.GPIO" = "^0.7.0"
gpiozero = "^1.5.1"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]