A simple Gamepad class in Python for receiving and reacting to inputs from almost any Gamepad. It runs in its own thread.
pip install inputs
Refer #L12-L16 for finding more button map keys and add it to the key_map
dictionary as required.
A simple Gamepad class in Python for receiving and reacting to inputs from almost any Gamepad. It runs in its own thread.
pip install inputs
Refer #L12-L16 for finding more button map keys and add it to the key_map
dictionary as required.
#!/bin/bash | |
echo "Installing OpenCV 4.5.1 on your Jetson TX2" | |
echo "It will take 2 hours !" | |
# reveal the CUDA location | |
cd ~ | |
sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf" | |
sudo ldconfig | |
# install the dependencies |
import cv2 | |
cap = cv2.VideoCapture(0) # Try 1 for USB cameras | |
ctr = 0 | |
while True: | |
ret, frame = cap.read() | |
if not ret: | |
print("[WARN] No feed found!") | |
print("[INFO] Closing...") |