How to get Keyboard Press in Python | Raspberry Pi Ultimate Robot [p3]

preview_player
Показать описание
In this tutorial, we will learn how to get input from a keyboard and send it to our Robot. We will make our Keyboard code modular which means it will be a separate file that will send signals to our main robot code. We will also see how we can link this to our motor module to send movement commands.

🚀🚀 My Urdu/Hindi AI YouTube Channel 🚀🚀

Code & Complete Course:

Premium Courses:
✔️ Computer Vision Game Development Course:
✔️ Computer Vision with Arduino Course:
✔️ Advanced Drone Programming Course:
✔️ Learn to Build Computer Vision Mobile Apps:
✔️ Jetson Nano Premium Course:

⚙️⚙️⚙️—-My Gear — ⚙️⚙️⚙️

Follow Me:

#ComputerVision
#OpenCV
#CVZone
Рекомендации по теме
Комментарии
Автор

I can not imagine how there are so fewer views on this insanely amazing video. I really like your videos and looking forward to learning more. Keep Going.

abidpatel
Автор

best chanel Murtaza's Workshop - Robotics and AI

مهووسالمعلوميات-شو
Автор

Thank you so much, I very much needed to learn how KeyPress works on the raspberry pi, so big thanks!

chaosspider
Автор

Sir Murtaza, You're just awesome.

ezzeldin
Автор

Hello Mr.Martaza, I hope you can help me out here, I have to same code at 13:01 when run I get this error File "/home/pi/robotmain.py", line 18, in main motor.stop(0.1)
AttributeError: 'tuple' object has no attribute 'stop' any ideas?

jimmykan
Автор

I am having an issue. I used your tutorial to control stepper motors. the code is setup so that one press of the up key moves the stepper 1 step clockwise and one press of the down key moves the stepper 1 step counter clockwise. The problem is that one press of a key seems to register as 6-7 presses of the key. You can see this happing in your tutorial for example, you have it setup to print what key was pressed and it prints the message several times on one press. I need my code to only happen once pre press not several do you know if this is possible using pygame key input and how i would achieve this?

zjjackson
Автор

Hello and thank you for the video. I just ran the code directly in the RaspberryPI and it works pretty well . What i would like to know is how to run it remotely? i am trying via ssh without success or how to run without the screen. Thanks again!

ecp
Автор

im really having trouble figuring out this problem ): if I press key up all 4 motors spin like they are supposed too, if I press down the 2 in the front spin and the back do not and the same happens for turning left or right the if I press left all 4 spin and if press right the 2 in the front spin and the back do not obviously I cannot drive the car like this and ive tried everything, Ive tried 3 different motor drivers and all have the same effect whatever is wrong is in the code

WARHERO
Автор

I got an error that say 'keynote is not defined' when I run the code, I found nothing wrong with the code I've been typing while following your video. Is there a package or something I need to install?

bobyau
Автор

Thanks for it bro. i was tried that. but car going to only left and right direction. I did not forward and bacward. where is the problem.

fatihkeskin
Автор

@Murtaza's Workshop - Robotics and AI Bro, could you please make a video to show how to incorporate this KeyPressModule into DataCollectionMain Module in OpenCV Neural Networks Car Part 1/3, similar to the way you did through JoyStickModule. I am unable to make getImg(Img, steering) a dynamic value through KeyPressModule as you did with JoyStickModule. Kindly please reply. I very badly need your help !!! Thank You Very Much in Advance !!!

ramanateja
Автор

This is great! Could you please show how to use an ultrasonic sensor for obstacle avoidance using gpiozero? 😁

kooky
Автор

I've an error :
>>> %Run KeypressModule.py
Traceback (most recent call last):
File "/home/pi/Documents/KeypressModule.py", line 4
win = pygame.display.set_mode((100, 100))
^
SyntaxError: invalid syntax

haroldthibault
Автор

dear, please share its code. thank you!

ansjaved