Go to advanced search

by realswz
Tue Jul 14, 2015 7:03 am
Forum: Python
Topic: slideshow with pygame
Replies: 2
Views: 908

slideshow with pygame

Hello

I have a button which is active-high and i want to display a slideshow out of 4 pictures when the button is pressed. The first three pictures should each be displayed for 3 seconds, the last should then stay there until another button is pressed. Is this possible with pygame?

thanks
by realswz
Tue Jun 30, 2015 6:59 am
Forum: Python
Topic: Changing active-low to active-high
Replies: 5
Views: 1627

Re: Changing active-low to active-high

thank you guys, works perfectly fine now.
by realswz
Mon Jun 29, 2015 1:49 pm
Forum: Python
Topic: Changing active-low to active-high
Replies: 5
Views: 1627

Changing active-low to active-high

Hi guys, i need your help. I have the following scripts that measures the time, a button is pushed, and loads an image with pygame depending on how long the button was pushed. The script works perfectly fine. The problem now is: The script is written for an active-low button, which creates a 0V leve...
by realswz
Mon Apr 20, 2015 6:32 am
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

Re: pygame.movie

any ideas?
by realswz
Thu Apr 16, 2015 10:33 am
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

Re: pygame.movie

thanks, it works now. but i have some other problems: - I can only stop the video one time. The terminal does some crazy stuff after i stop it. If i use the same terminal window again to start the script/video again, it won't stop, but if i open a new terminal and start it, it works again. Plus in t...
by realswz
Wed Apr 15, 2015 11:36 am
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

Re: pygame.movie

if i use the dbuscontrol.sh script to stop it ( chmod +x dbuscontrol.sh sudo mv dbuscontrol.sh /usr/local/bin ) and in my python script i then use: os.system('dbuscontrol.sh stop') Nothing happens if I send "stop". After i close the script i see the following error in the terminal: Error org.freedes...
by realswz
Mon Apr 13, 2015 1:55 pm
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

Re: pygame.movie

it works fine with this lines command1='omxplayer', '-o', 'hdmi', '/media/A2A7-1908/moviegopro.mpeg' sp.Popen(command1) the only things i need are some commands: - to close/stop the video (not pause!) - to convert the playing video into window mode and back in fullscreen any ideas? thanks in advance
by realswz
Fri Apr 10, 2015 1:03 pm
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

Re: pygame.movie

It works now with the following script: import pygame FPS = 60 pygame.init() clock = pygame.time.Clock() movie = pygame.movie.Movie("/media/A2A7-1908/test.mpg") screen = pygame.display.set_mode(movie.get_size()) movie_screen = pygame.Surface(movie.get_size()).convert() movie.set_display(movie_screen...
by realswz
Tue Apr 07, 2015 6:35 am
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

Re: pygame.movie

any idea?
I've seen the thing now with the MPEG2-license that i need to buy. Is there no other way to do it?
If not, could anyone who has the MPEG license test if this works? I dont want to spend money on something that doesn't work at the end..
by realswz
Thu Apr 02, 2015 7:13 am
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

Re: pygame.movie

With the slash, this weird error occurs: (The code is the same) pi@raspberrypi ~ $ sudo python test1.py Warning: picture block before sequence header block Warning: picture block before sequence header block Warning: picture block before sequence header block Warning: picture block before sequence h...
by realswz
Wed Apr 01, 2015 2:16 pm
Forum: Python
Topic: pygame.movie
Replies: 14
Views: 5253

pygame.movie

Hi guys I tried to play a video with pygame. When i execute the script, a black window opens and the following error occurs in the terminal: pi@raspberrypi ~ $ sudo python test1.py Traceback (most recent call last): File "test1.py", line 12, in <module> movie = pygame.movie.Movie('media/A2A7-1908/mo...
by realswz
Thu Mar 26, 2015 1:34 pm
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Re: Showing an image with gpio

thank you paddyg, this code works perfectly. But now i have some questions WHY it actually does work :D Actually there are two things i dont understand: previous_state = True time_pressed = -1.0 while True: button_state = GPIO.input(button1) if not button_state and previous_state: when_pressed = tim...
by realswz
Thu Mar 26, 2015 9:52 am
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Re: Showing an image with gpio

I've created this little test script for detecting the duration of the press and then show image 1 or image 2 based on the time the button was pressed. It doesn't create any error but it still won't work. Any idea? Maybe theres something wrong with the identation, but i can't figure out what exactly...
by realswz
Wed Mar 25, 2015 2:45 pm
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Re: Showing an image with gpio

Thank you for the hint about the videos and the sleep, i will try it. I'm a little bit unexperienced at python programming, what do you mean with GPIO Callback and why is it a problem if it does the block over and over again? And with which term should i search about the long-press code? is there a ...
by realswz
Wed Mar 25, 2015 10:11 am
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Re: Showing an image with gpio

I modified the script, it works now the way i want it. I just have the question if i could make it more efficient and if there are some useless lines i've written. Keep in mind that this is only a test with 2 buttons, but the final script should have 10 buttons in it. So maybe there is an easier way...
by realswz
Wed Mar 18, 2015 8:04 am
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Re: Showing an image with gpio

thank you for your example. Two questions: I dont need a slideshow and i have more than one switch, for each image one button. What do i need to change to only show the image X if switch X is pressed and image Y when switch Y is pressed? And can i modify the script that it shows videos if the input ...
by realswz
Fri Mar 13, 2015 2:57 pm
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Re: Showing an image with gpio

So isn't this possible with imagemagick or the default image viewer of raspbian?
pygame looks a bit more difficult than the stuff i did so far, or am i wrong?
by realswz
Fri Mar 13, 2015 2:27 pm
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Re: Showing an image with gpio

Thanks guys, your tipps worked. Now i have two more little questions: 1. What command do i need to display the picture in imagemagick in fullscreen (without any toolbars and things) and without the little "pan icon" window? 2. I have two pictures that should be displayed. Which command do i need to ...
by realswz
Wed Mar 04, 2015 1:45 pm
Forum: Python
Topic: Showing an image with gpio
Replies: 23
Views: 6254

Showing an image with gpio

Hello guys I've a script for showing a picture when a button connected to the gpio-inputs is pressed. #!/usr/bin/env python import RPi.GPIO as GPIO from PIL import Image im=Image.open("/home/pi/Rock.png").convert("RGB") buttonPin = 25 GPIO.setmode(GPIO.BCM) GPIO.setup(buttonPin,GPIO.IN) while True: ...

Go to advanced search