Kwikset keypad lock and raspberry pi11/24/2023 I mean, just pushing buttons and having the number i push show up on the screen is fun for only so long. Poling is not really the best way to do this, even if I can make it less CPU intensive.įinally, I need to find a use for this. Third, and I'm not sure if there's a way for this to happen, the code should be event driven. Next, the code should be object oriented so I can import it into other projects easily. Better, but not great.įirst, as already said, the code I created is a little CPU intensive, so the code could be cleaned up to fix that issue. I put in a pause of 1/10 a second at the start of the polling loop, and this dropped the CPU usage to about 50%. This made the "bounce" go away.Īdditionally, the CPU ran at 100% while polling the rows and columns. To eliminate this, I put in a sleep statement of 1/100 of a second in to the code as the button was pressed and another when the button was released. The buttons tended to "bounce"-show more than one press per press. There were two main issues with this project. The actual pins you use don't really matter, as you'll include them in the code, which I've attached to this step.Īnd a multidimensional list for the key/button combinationsįinally, there's a loop to poll the columns and see which row was pushed: I marked the back of the keypad with the key/pin combinations. I desoldered the ribbon cable and installed header pins I scavenged off an old video card. Now that I knew what it did, I had to make it do it.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |