Raspberry Pi LESSON 33: Creating a Python Class and Library for Reading a Keypad

preview_player
Показать описание
Announcing the Most Awesome Raspberry Pi Lessons of All Times! This time we RUMBLE!

In this class series, we will be using the most excellent Sunfounder Ultimate Raspberry Pi kit, available here: (Affiliate Link)

In this video lesson I will show you how the 16 button keypad works, and how to use it with the Raspberry Pi. The keypad allows user input when the Raspberry pi is being used remotely. We will create a python class and library for easily getting user input from the 16 pad keypad.

If you want to grab those cool little straight jumper wires I am using to keep my breadboard builds neat and clean you can snag a box of them here:

If you guys are interested in the oscilloscope I am using, you can pick one up here (affiliate link):

You guys get your hardware ordered so you can follow along at home!

You will also need a Raspberry Pi. I suggest the Raspberry Pi 4. If you do not already have one, this is the most suitable gear I could find:

The Raspberry Pi's are sort of pricy right now, so you can look on ebay or elsewhere to see if there are any deals. You will need a SD card. If you do not already have one, this is a good one:

I like using a wireless keyboard and mouse to have fewer wires. You can certainly use your USB keyboard and mouse, but if you want a nice wireless one, this one works on the pi. We demonstrate this by using a button switch to control a LED.

You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

#TUTORIAL
#KEYPAD
#RASPBERRYPI
Рекомендации по теме
Комментарии
Автор

This lesson has been really helpful! Thanks a lot!

ArjanvanderMeij
Автор

Most excellent lesson. I needed the reminder on how to make the classes and methods.

tntragan
Автор

i literally cannot thank you enough sir, i have a competition next week where i have to code the program for an autonomous boat, and your arduino tutorials have been literally my knight in shining armor i dont what i would have done if not for you. you are such an amazing teacher it boggles my mind, wish i had encountered more teachers like you over the years. thank you and good health Mr. Paul <3

saad
Автор

really great lesson on the keypad. This lesson really showed that I need to go back and look a methods and classes again😀

andrewnorburn
Автор

I started on this series when I bought the kit and have never used python before this. I really appreciate the way you go into and demonstrate and explain everything (even not cutting your mistakes). When going through the lessons on ADC, dht, and LCD I got curious about the setups for those libraries and really got a lot out of this lesson. Fantastic! Thank you.

LorenBurdette
Автор

Another great lesson this week. No homework so just stopped by to thank Paul for his commitment to teaching tech. Hard to believe that less than 2 years ago I had not written a single line of Python. Please keep up the good work!

keithlohmeyer
Автор

I am legend!
I did go the easy route and just use a function, but I enjoyed watching the video after. The video gives a really great review on python classes (which I have not done in a while).
One improvement on the code that I found helpful for debugging was to have the program print a '*' every time a button was pressed. This made it easier to see if the program was working right.
This video was helpful as I am working on a portable microscope for some amateur ecology studies. I plan on using one of these cheap keypads for prototype versions of the microscope.
Great video as always!

jonathanlanders
Автор

Another great Lesson. I'm really enjoying learning how these pieces of code, classes, methods and functions etc all interact with each other. Scrips of code are starting to make more sense to me now. Thank-you very much.

daveCotterill
Автор

Another great lesson, you are shaping my future and wanted to let you know this, keep up with the videos; i'm doing the homeworks, however i have failed to record them and send them to share. BLESSINGS!

scottwoods
Автор

Great lesson. I had to go back to the old Python classes to review classes and methods.

martinlewis
Автор

Thanks Paul! That was really cool. I have to look up your class and library tutorials because things are clicking.

stephenlightkep
Автор

You are the miracle man Paul. I've gotten behind a bit, love this lesson. Thanks for all your hard work. God Bless you and your family.

opalprestonshirley
Автор

Thanks for another most-excellent lesson Paul. I did the homework using a Python function, but I don't think I could have figured out all the selfie-class stuff. I look forward to more lessons that make use of the SunFounder devices. God bless you for all the time and effort you devote these lessons.

cbrombaugh
Автор

I am legend! I like it when your solution is different from mine, so I'm still learning something new even though I did do the homework. Using the class and creating the library was super interesting. Thanks!

michielverheyen
Автор

Yes, the last lesson was simply YET I used a function and not a class. So this video was very helpful in understanding classes in Python! Thank you!

OZtwo
Автор

Thanks for the great lesson! This was my first foray into Functions, Class, Methods, Objects, and Libraries. There is so much for me yet to learn here...!
You mentioned a previous lecture about these things if one wanted to learn more. I went to your website to try to find and view it. No luck, also don't see a link in description. I have also noticed that you don't have a lesson listing for this series like you do for the Fusion360 lessons(which will hopefully be my next project). I wonder what else is not clearly listed, because I think your teaching style is great, and I would like to take more of your online classes.

Again, thanks! I appreciate you and all the hard work you put into your lessons.

billgregg
Автор

Thanks for explaining what a library is at a more fundamental level. I haven’t really understood what these things we’ve been importing are.

smitt
Автор

thanks, Paul....going to visit and take your earlier Python Tutorials .. where you introduce Threads, Functions, Methods and Classes.... yes...still having FUN.... learning...

davidschnider
Автор

I made a code that stores 5 characters. If more characters are pressed the first character of the string is deleted. When the D button is pressed, the code compares it to a password string. If the password is correct it will print a string keyword and the stored characters are deleted. If the D key is pressed when the password is wrong it will print "wrong password". I did not put this in a method tough.

alanabela
Автор

that was quite a lesson..my brain is fried..but in a pleasant way

johnhechtlinger
welcome to shbcf.ru