Raspberry Pi Devastator Robot #4: Pygame & Speed Control

preview_player
Показать описание
Raspberry Pi Zero Devastator robot improvements -- using Pygame to read the keyboard, and the PWM inputs of the L298N for motor speed control.

You can download the code for this and previous episodes from:

The first three episodes in this series are:

Raspberry Pi Devastator Robot #1:

Raspberry Pi Devastator Robot #2:

Raspberry Pi Devastator Robot #3:

IMPORTANT NOTE:

More videos on SBCs and broader computing and related topics can be found at:

Chapters
00:00 Introduction
01:04 Project review
06:25 Reading the keyboard in Pygame
09:24 Pygame robot control code
12:09 First test
13:27 PWM speed control
16:42 Final test
Рекомендации по теме
Комментарии
Автор

This video is why you garner so much respect Christopher, in an increasingly superficial society, you delve into the minutiae of how things work and why. Excellent. Thank you.

RoboNuggie
Автор

I’ve been waiting for this video to come out for a while... it was definitely worth the wait, great video as usual Christopher 👌😊

Hi-kqrx
Автор

The tank is back. Speed control is added. Always nice to see the robot in action.

rogerkoh
Автор

Always nice to listen to you talk about electronics whilst I peel my potatoes

DrBenChem
Автор

I have built a robot following your Guides and I have even added a remote firework launcher using a quad relay board. Using 4x 18650 batteries the tank goes really fast as well. Thank You Christopher for the video`s on what to do, You are very clear with instruction. All I need now is a PTZ camera with a live view so I can then drive it up and down the street, on my WiFi Launching my rockets lol.

Cluffmaster
Автор

It’s always a good Sunday when @ExplainingComputers releases a video about the very thing I am working on. Thank you Chris.

zeberto
Автор

Great video!
An improvement suggestion: If your robot gets out of range it will never receive the KeyUp event, so it will continue advancing forever.
Solution: the controller sends the status of the keys every second not only when they are pressed or released. The robot has a timeout so if it doesn't receive an update every second it stops.
You can test that by leaving a key pressed and switching off the controller, so it never sends the keyUp event and the robot initiates the emergency stop.

IsaacPiera
Автор

Ok, loved the technical bits. But, my favorite thing about THIS video was the robot's frowny face! :)

rikprince
Автор

Wife: "Raspberry pie? Why on earth would you possibly want a raspberry pie? You don't even like raspberries!"
Me: (Points at Explaining Computers Devastator Robot video and whimpers.)

lawrenceallwright
Автор

Just watching this made me feel like a child again. I wish we had stuff like this "in my
Genuinely Your channel is one of the most reliable for good content. Thanks so much!

theoriginaldylangreene
Автор

Greatly enjoyed the latest installment of the robotics series. Keep up the good work!

resrussia
Автор

As soon as I thought you done with the pi zero robot, you strike me again with another video, really like it hope to see more.

rohanverma
Автор

Loved it, and I can't believe the Robot found a stick. How crazy is that? Great Job Chris

JoseLopez-ozxm
Автор

Fantastic series, just build this and enjoyed it a lot. Thanks for this. I changed 1 thing. I used pin 16 instead of pin 7. Because every pin above 8 seems to be in a "low" state. This way u don't need a switch. The robot will not move at startup. Hope this helps someone.

satch
Автор

Very good! Enhancement: A joystick to control by degrees via cartesian X/Y coordinates "while in motion" vs. key down input. (Hover Craft need also.)

muddyexport
Автор

This robot project is interesting. And it looks stunning. A teeny tiny explorer.

PS_Tube
Автор

This is one of my favorite projects; it's nice to see it filled out with some simple (but clever) code and improved hardware. Thanks for another great video.

srtcsb
Автор

So many opportunities for customization here -- one could modify the code to automatically slow the motors during a turn to make turning more accurate. And I see that when you let go of *any* key, all the motors would stop. One could customize that part of the code to check and see *which* key you let go of, so that if you, say, press and release one of the "speed" keys while holding the forward key down, it won't stop the motors until you release the forward key. So many possibilities here! Love it!

LMacNeill
Автор

I had been wondering if the Devastator would return for an update and not disappointed. Using PWM is definitely a much better approach to getting the robot moving in a controlled fashion especially with the hard plastic tracks. Looking forward to the next instalment

dazryan
Автор

Thanks for this. I started a project yesterday using the L298N, so the timing is impeccable, very much unlike my coding.

qwkimball