Posts: 1,298
Threads: 38
Joined: Sep 2016
You need to show us what you've tried so far. We would be happy to guide you along, make suggestions, etc, but will not not write the program for you. Make sure you read the Help / Rules doc (particularly the section on BBCode) in order to post your code, output and errors correctly.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 69
Threads: 0
Joined: Dec 2017
Why not just create a GUI?
• Have a picture of a punching bag at rest.
• Have event handlers that calls a function when you press a certain key. This could be replace later on.
• Replace picture of a bag being hit.
• Place a for loop and have the punching bag animate (Optional)
• After a certain period have a picture of a punching bag at rest.
Ref:
https://projects.raspberrypi.org/en/proj...-with-guis, see picture widgets. (uses guizero)
http://effbot.org/tkinterbook/tkinter-ev...ndings.htm (uses tkinter)
When my code doesn't work I don't know why **think** and when my code works I don't know why **think**
Posts: 69
Threads: 0
Joined: Dec 2017
(Dec-27-2017, 04:36 PM)nilamo Wrote: (Dec-27-2017, 01:55 PM)Terafy Wrote: Why not just create a GUI?
• Have a picture of a punching bag at rest.
• Have event handlers that calls a function when you press a certain key. This could be replace later on.
• Replace picture of a bag being hit.
• Place a for loop and have the punching bag animate (Optional)
• After a certain period have a picture of a punching bag at rest.
Ref:
https://projects.raspberrypi.org/en/proj...-with-guis, see picture widgets. (uses guizero)
http://effbot.org/tkinterbook/tkinter-ev...ndings.htm (uses tkinter)
I don't understand how that's different from what OP asked for. pygame literally is just a gui. If anything, using tkinter would be harder, as you're moving widgets around.
To OP:
Sounds like a cool idea. You can (and should) "simulate" raspberrypi events using the keyboard, so the program does everything it needs to do when "something" happens. Then, as you suggested, you'd just need to replace that "something" with sensor output from the pi.
As to where to start, the pygame docs (http://pygame.org/docs/) have an intro page that can help you get started. If you have some code, and need some help with it, we'll help, but we won't do your project for you :p
Sorry, still newish to python (Still got a lot to learn). Was only trying to help
When my code doesn't work I don't know why **think** and when my code works I don't know why **think**