SimpleJoyCon 1.0.2__tar.gz → 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/PKG-INFO +1 -1
- simplejoycon-1.0.4/SimpleJoyCon/__init__.py +2 -0
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon/joycon_l.py +7 -8
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon/joycon_r.py +6 -7
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon.egg-info/PKG-INFO +1 -1
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/setup.py +1 -1
- simplejoycon-1.0.2/SimpleJoyCon/__init__.py +0 -2
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/README.md +0 -0
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon/componentes.py +0 -0
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon.egg-info/SOURCES.txt +0 -0
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon.egg-info/dependency_links.txt +0 -0
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon.egg-info/requires.txt +0 -0
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/SimpleJoyCon.egg-info/top_level.txt +0 -0
- {simplejoycon-1.0.2 → simplejoycon-1.0.4}/setup.cfg +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import hid
|
|
2
2
|
import time
|
|
3
3
|
from .componentes import ContenedorBotonesL, Palanca, Bateria, SensorMovimiento, Boton
|
|
4
|
-
|
|
5
4
|
class JoyconL:
|
|
6
5
|
def __init__(self):
|
|
7
6
|
self.packet_counter = 0
|
|
@@ -26,12 +25,13 @@ class JoyconL:
|
|
|
26
25
|
break
|
|
27
26
|
except Exception:
|
|
28
27
|
print(" -> Control Izquierdo no detectado. Reintentando... (Presiona un botón en el Joy-Con)", end="\r")
|
|
29
|
-
time.sleep(1
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
time.sleep(0.1)
|
|
29
|
+
try:
|
|
30
|
+
print("\n[OK] ¡Joy-Con L Conectado!")
|
|
31
|
+
self._enviar_subcomando(0x48, [0x01])
|
|
32
|
+
self._enviar_subcomando(0x40, [0x01])
|
|
33
|
+
except Exception as e:
|
|
34
|
+
print(f"[SimpleJoycon Joy-Con L] Error: {e}")
|
|
35
35
|
def _next_id(self):
|
|
36
36
|
c = self.packet_counter & 0x0F
|
|
37
37
|
self.packet_counter += 1
|
|
@@ -44,7 +44,6 @@ class JoyconL:
|
|
|
44
44
|
packet.extend(data_bytes)
|
|
45
45
|
packet += [0x00] * (49 - len(packet))
|
|
46
46
|
self.device.write(bytes(packet))
|
|
47
|
-
time.sleep(0.01)
|
|
48
47
|
|
|
49
48
|
def vibracion(self, fuerza):
|
|
50
49
|
fuerza = max(0.0, min(1.0, float(fuerza)))
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import hid
|
|
2
2
|
import time
|
|
3
3
|
from .componentes import ContenedorBotonesR, Palanca, Bateria, SensorMovimiento, Boton
|
|
4
|
-
|
|
5
4
|
class JoyconR:
|
|
6
5
|
def __init__(self):
|
|
7
6
|
self.packet_counter = 0
|
|
@@ -27,14 +26,15 @@ class JoyconR:
|
|
|
27
26
|
except Exception:
|
|
28
27
|
# Si falla (porque el control está apagado), espera 1 segundo y reintenta
|
|
29
28
|
print(" -> Control Derecho no detectado. Reintentando...", end="\r")
|
|
30
|
-
time.sleep(1
|
|
29
|
+
time.sleep(0.1)
|
|
31
30
|
|
|
32
31
|
# Inicialización de hardware una vez conectado
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
try:
|
|
33
|
+
print("\n[OK] ¡Joy-Con R conectado!")
|
|
34
|
+
self._enviar_subcomando(0x48, [0x01])
|
|
35
|
+
self._enviar_subcomando(0x40, [0x01])
|
|
36
36
|
except Exception as e:
|
|
37
|
-
print(
|
|
37
|
+
print(f"[SimpleJoycon Joycon R] ERROR: {e}")
|
|
38
38
|
raise
|
|
39
39
|
|
|
40
40
|
def _next_id(self):
|
|
@@ -49,7 +49,6 @@ class JoyconR:
|
|
|
49
49
|
packet.extend(data_bytes)
|
|
50
50
|
packet += [0x00] * (49 - len(packet))
|
|
51
51
|
self.device.write(bytes(packet))
|
|
52
|
-
time.sleep(0.01)
|
|
53
52
|
|
|
54
53
|
def vibracion(self, fuerza):
|
|
55
54
|
fuerza = max(0.0, min(1.0, float(fuerza)))
|
|
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="SimpleJoyCon",
|
|
9
|
-
version="1.0.
|
|
9
|
+
version="1.0.4",
|
|
10
10
|
description="Una libreria de bajo nivel simplificada, estetica y sin comillas para usar Joy-Cons en Python",
|
|
11
11
|
long_description=long_description, # <--- LE DICE A PYPI QUE USE EL README
|
|
12
12
|
long_description_content_type="text/markdown", # <--- CORRIGE EL FORMATO A MARKDOWN
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|