Go to advanced search

by elParaguayo
Sun Jul 27, 2014 8:14 am
Forum: Python
Topic: Importing questions
Replies: 5
Views: 1006

Re: Importing questions

Two things to add here: 1) "import wx" does not necessarily mean there is a file called wx.py. It is possible to turn a folder into a python package by including an "__init__.py" file within the folder. I've not used wx so I can't say if that's the case here. 2) Modules/Packages are often located in...
by elParaguayo
Tue Jul 22, 2014 11:32 am
Forum: Graphics, sound and multimedia
Topic: Lunchbox Internet Radio Guide
Replies: 10
Views: 10607

Re: Lunchbox Internet Radio Guide

This is really smart! I'm doing something similar in that I have a Pi, display, speaker and buttons which I plan to put in a lunch box however the buttons will just trigger various train related sounds for my son to use when playing with his toys. All the electronics work nicely, I'm just wondering ...
by elParaguayo
Tue Jul 22, 2014 7:39 am
Forum: Graphics, sound and multimedia
Topic: Help needed: Using GPIO to switch off amplifier circuit
Replies: 10
Views: 3389

Re: Help needed: Using GPIO to switch off amplifier circuit

mahjongg, Just wanted to say thanks for your help. I've got the amp and speaker wired up and they're working very nicely. I've also set up pygame such that it mutes the speaker by changing the state of a GPIO pin any time there's nothing playing. All I need to do now is get all this mounted in a box...
by elParaguayo
Sun Jul 20, 2014 4:23 pm
Forum: Python
Topic: Just playing half the sound
Replies: 7
Views: 1665

Re: Just playing half the sound

Does the audio work in a different programme? I.e. are you sure this is a software problem rather than hardware?
by elParaguayo
Sat Jul 19, 2014 6:04 am
Forum: Python
Topic: Just playing half the sound
Replies: 7
Views: 1665

Re: Just playing half the sound

That's strange. I've used pygame to play audio out of the analog jack without any issues. I'll see if I can dig up my code later.

One question, are you using python 2 or 3?
by elParaguayo
Fri Jul 04, 2014 9:03 pm
Forum: Graphics, sound and multimedia
Topic: Help needed: Using GPIO to switch off amplifier circuit
Replies: 10
Views: 3389

Re: Help needed: Using GPIO to switch off amplifier circuit

Thanks.

I've ordered all the parts, now I just need to find the time to build it!
by elParaguayo
Thu Jul 03, 2014 2:21 pm
Forum: Graphics, sound and multimedia
Topic: Help needed: Using GPIO to switch off amplifier circuit
Replies: 10
Views: 3389

Re: Help needed: Using GPIO to switch off amplifier circuit

Thanks Mahjongg - that makes some sense to me. I assume the fact that the Pi would be putting 3.3v to the shutdown pins even though they're already pulled high wouldn't have any detrimental impact on anything. EDIT: Also, if I'm using this in Mono mode can I just tie one output to ground by linking ...
by elParaguayo
Thu Jul 03, 2014 12:52 pm
Forum: Graphics, sound and multimedia
Topic: Help needed: Using GPIO to switch off amplifier circuit
Replies: 10
Views: 3389

Re: Help needed: Using GPIO to switch off amplifier circuit

Thanks both for the quick replies. mahjongg, humour me please: There is a manual that says: "You can turn off the amplifier for each channel separately. To turn off the right channel, connect SDR to ground. To turn off the left channel, connect SDL to ground. By default these pins have pullups to VD...
by elParaguayo
Thu Jul 03, 2014 12:25 pm
Forum: Graphics, sound and multimedia
Topic: Help needed: Using GPIO to switch off amplifier circuit
Replies: 10
Views: 3389

Re: Help needed: Using GPIO to switch off amplifier circuit

To any moderators reading this: please feel free to move the post to a different sub-forum if you think this would be best suited elsewhere.
by elParaguayo
Thu Jul 03, 2014 12:19 pm
Forum: Graphics, sound and multimedia
Topic: Help needed: Using GPIO to switch off amplifier circuit
Replies: 10
Views: 3389

Help needed: Using GPIO to switch off amplifier circuit

I'm completely new to the creating-a-hardware-project-from-scratch aspect of the Pi but I'm quite excited by the prospect of building something for my son that I think he'll really love playing with (involving buttons, sounds and flashing lights - what's not to love?!) In respect of the sound, I was...
by elParaguayo
Mon Jun 23, 2014 7:59 am
Forum: Python
Topic: Python loop script stops running: why?
Replies: 9
Views: 8797

Re: Python loop script stops running: why?

Don't think this would cause an error, but I think the line

Code: Select all

s.ehlo
should be

Code: Select all

s.ehlo()
Also, do you need that line twice?

Have a look at this: http://stackoverflow.com/questions/1014 ... ing-python
by elParaguayo
Sat Jun 21, 2014 3:23 pm
Forum: Python
Topic: Remove and Also Loop
Replies: 6
Views: 1732

Re: Remove and Also Loop

My pleasure and I wish you and the future Mrs Rob all the very best.
by elParaguayo
Sat Jun 21, 2014 2:04 pm
Forum: Python
Topic: Remove and Also Loop
Replies: 6
Views: 1732

Re: Remove and Also Loop

You could try this: #!/usr/bin/python from time import sleep from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate from datetime import datetime, time # Initialize the LCD plate. Should auto-detect correct I2C bus. If not, # pass '0' for early 256 MB Model B boards or '1' for all later versions lc...
by elParaguayo
Sat Jun 21, 2014 1:50 pm
Forum: Python
Topic: How do I run a script many times with out re-programming?
Replies: 4
Views: 9252

Re: How do I run a script many times with out re-programming

I assume you've got a limited number of commands. You probably just want to do something in a "while" loop and break the loop if you receive a certain command. e.g. finished = False while not finished: command = raw_input("Enter command: ") if command == "exit": finished = True elif command == "prin...
by elParaguayo
Thu Jun 19, 2014 8:37 am
Forum: Python
Topic: No attribute to 'output'?
Replies: 8
Views: 1344

Re: No attribute to 'output'?

I would have thought that this line: GPIO.setup(GPIO.OUT) should have been GPIO.setup(12, GPIO.OUT) (see this page: http://sourceforge.net/p/raspberry-gpio-python/wiki/Outputs/) I can't see the code you posted as that site's blocked at work. Any reason why you can't paste them here? I would also put...
by elParaguayo
Thu Jun 19, 2014 8:33 am
Forum: Python
Topic: Switch - Email Notifier Code
Replies: 10
Views: 3828

Re: Switch - Email Notifier Code

I'd also advise not including your email address in your posts.
by elParaguayo
Mon Jun 16, 2014 2:24 pm
Forum: Python
Topic: Iterating and removing items from a list
Replies: 3
Views: 1032

Re: Iterating and removing items from a list

Quite a common problem this and I see the two best answers have already been mentioned:
1) Copy list
2) Work backwards

Both are discussed here (with example code): http://stackoverflow.com/questions/6022 ... -over-list
by elParaguayo
Thu Jun 12, 2014 7:38 pm
Forum: Python
Topic: getting stuck in fullscreen
Replies: 1
Views: 1854

Re: getting stuck in fullscreen

Try changing your last line to:

Code: Select all

pygame.quit()
by elParaguayo
Wed Jun 11, 2014 2:58 pm
Forum: Python
Topic: Execute python code through Web
Replies: 7
Views: 3604

Re: Execute python code through Web

The python script would, I think, need to run with superuser privileges as the OP wants to access GPIO. I suspect it's possible to do this with CGI but might get a little bit complicated.
by elParaguayo
Wed Jun 11, 2014 12:13 pm
Forum: Python
Topic: Execute python code through Web
Replies: 7
Views: 3604

Re: Execute python code through Web

I assume this is your question on Stack Overflow as well: http://stackoverflow.com/questions/24162048/execute-python-code-through-web If so, there seem to be some answers there for you already. One recommendation was to use Flask. I've not tried it before, but this may be a good place to start: http...
by elParaguayo
Tue Jun 10, 2014 7:27 am
Forum: Python
Topic: python
Replies: 6
Views: 1056

Re: python

As much as I'd love to see this turn into 20 questions I think we should just fix this as soon as possible! Stuartie, we need much more info if you want us to help you. Providing your full code (in code tags) would be the easiest. Or post a link to the code you copied. Without either of those there ...
by elParaguayo
Sat Jun 07, 2014 8:50 am
Forum: Python
Topic: Raspberry Pi 20x4 + Camera
Replies: 3
Views: 831

Re: Raspberry Pi 20x4 + Camera

Glad it works now.
by elParaguayo
Sat Jun 07, 2014 8:12 am
Forum: Python
Topic: Raspberry Pi 20x4 + Camera
Replies: 3
Views: 831

Re: Raspberry Pi 20x4 + Camera

I've no idea what this code does, but the last set of "if" statements looks a bit odd. I think you mean to use "elif" rather than "if". i.e. if Kameros_Kokybes_Indeksas is HD1080 it then sets this to HD720 but then, instead of exiting the "if" block, you start a new one and the "HD720" condition is ...
by elParaguayo
Sat Jun 07, 2014 5:41 am
Forum: Python
Topic: editing index.html in webiopi
Replies: 10
Views: 9594

Re: editing index.html in webiopi

My pleasure. Well done for getting it to work.
by elParaguayo
Fri Jun 06, 2014 3:31 pm
Forum: Python
Topic: editing index.html in webiopi
Replies: 10
Views: 9594

Re: editing index.html in webiopi

I think the "out" means you want to be able to to control the state of the pin, rather than read it as an input. The issue is whether you want the pin to be initially set high or low. It looks like you can do this by editing the webiopi config file: https://code.google.com/p/webiopi/wiki/CONFIGURATI...

Go to advanced search