Go to advanced search

by croston
Mon Jun 24, 2013 5:11 pm
Forum: Python
Topic: help on code
Replies: 17
Views: 1741

Re: help on code

You have a clash between troco the function and troco the variable. You will have to rename one or the other.
by croston
Thu Jun 20, 2013 9:21 pm
Forum: Python
Topic: rpi.gpio error 'module' object has no attribute 'setmode'
Replies: 12
Views: 16723

Re: rpi.gpio error 'module' object has no attribute 'setmod

You have a really ancient version of RPi.GPIO - before setmode() was added. I suggest you upgrade it. As you have manually installed it, you will have to manually delete it to pick up the latest version from Raspbian.
by croston
Thu Jun 20, 2013 11:08 am
Forum: Troubleshooting
Topic: GPIO Pin13 (and more)
Replies: 9
Views: 1628

Re: GPIO Pin13 (and more)

George_P wrote:Can I use all the GPIO pins? Are they configured as GPIO on reset?
I think I saw somewhere that all can be used as GPIO if they have not been configured otherwise, except TxD and RxD (pins 8 and 10)?
That is correct.
by croston
Wed Jun 19, 2013 8:31 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO lever swich
Replies: 4
Views: 1714

Re: GPIO lever swich

The RPi.GPIO Python module has changed and has more capability than when the example you have based your code on was written. I suggest reading the following for a more up to date way of doing things: http://code.google.com/p/raspberry-gpio-python/wiki/Inputs As for the symptoms you are seeing - hav...
by croston
Wed Jun 19, 2013 11:30 am
Forum: General discussion
Topic: You and Yours
Replies: 13
Views: 1883

Re: You and Yours

Good call Clive - you were right!
by croston
Tue Jun 18, 2013 4:36 pm
Forum: General discussion
Topic: You and Yours
Replies: 13
Views: 1883

Re: You and Yours

I think this is the URL for the episode in question: http://www.bbc.co.uk/programmes/b02x93d4 Judging by the summary they are completely missing the point of the RPi: Computers are on sale for £24 to get people on benefits and school children online. But how accessible are they? Fingers crossed that...
by croston
Mon Jun 17, 2013 8:04 pm
Forum: Troubleshooting
Topic: GPIO Pin13 (and more)
Replies: 9
Views: 1628

Re: GPIO Pin13 (and more)

You will need to delete the old version of RPi.GPIO that you installed manually. It's a case of deleting the relevant files for the old version you discovered using the 'find' command in my earlier post. After this, the newer version installed as part of Raspbian will start working. Unfortunately, E...
by croston
Mon Jun 17, 2013 6:55 pm
Forum: Python
Topic: Modify a visible variable?
Replies: 14
Views: 1688

Re: Modify a visible variable?

Apologies - spotted the mistake in the Python 2 example now.
by croston
Mon Jun 17, 2013 6:46 pm
Forum: Python
Topic: Modify a visible variable?
Replies: 14
Views: 1688

Re: Modify a visible variable?

I have corrected the mistake in my original post. Sorry!
by croston
Mon Jun 17, 2013 6:41 pm
Forum: Automation, sensing and robotics
Topic: Failsafe(r) use of GPIO pin driving critical applications
Replies: 41
Views: 13294

Re: Failsafe use of GPIO pin driving critical applications

I also received a PM. I wouldn't use the RPi+Linux for anything where you are concerned about reliability as in this case. I have a cheap and easy hardware+software solution that interfaces with a RPi - I will post technical details here tomorrow when I get chance. It's what I have designed for over...
by croston
Mon Jun 17, 2013 6:28 pm
Forum: Python
Topic: Modify a visible variable?
Replies: 14
Views: 1688

Re: Modify a visible variable?

Try: from __future__ import print_function print("\rCore Temp : %d degrees" % degVar, end="") Note: this forces you to use Python 3 syntax for print() statements in Python 2. This is good practice for future compatibility. The Python 2 equivalent (untested, I could be wrong): print "\rCore Temp : %d...
by croston
Mon Jun 17, 2013 5:33 am
Forum: Troubleshooting
Topic: GPIO Pin13 (and more)
Replies: 9
Views: 1628

Re: GPIO Pin13 (and more)

Sounds like you are using a really ancient version of RPi.GPIO then - older than Revision 2 boards! Have you been copy-and-pasting out of date command line instructions off the internet? These tend to install an old version of RPi.GPIO that overrides the latest version that comes with Raspbian. A qu...
by croston
Sun Jun 16, 2013 8:46 pm
Forum: Troubleshooting
Topic: GPIO Pin13 (and more)
Replies: 9
Views: 1628

Re: GPIO Pin13 (and more)

Make sure you have up to date firmware and RPi.GPIO:

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
What is the result of:

Code: Select all

import RPi.GPIO as GPIO
GPIO.VERSION
GPIO.RPI_REVISION
by croston
Thu May 16, 2013 1:00 pm
Forum: Off topic discussion
Topic: How useful is pseudocode?
Replies: 18
Views: 6426

Re: How useful is pseudocode?

I will post a more detailed reply in the other forum in question (I've been following that thread). To summarise: I hate using and reading pseudocode in the real world. It may have it's uses in teaching - I don't know because I am a professional coder and not a teacher. A bit like teaching scratch r...
by croston
Tue Apr 23, 2013 2:07 pm
Forum: Python
Topic: no Module named RPi.GPIO
Replies: 2
Views: 1792

Re: no Module named RPi.GPIO

Did you download and install Python 3.3.1 yourself using something other than apt-get? If so, you will have to download, build and install RPi.GPIO yourself manually.
by croston
Sun Apr 21, 2013 9:24 pm
Forum: Python
Topic: Can't get debounce to work..
Replies: 13
Views: 5387

Re: Can't get debounce to work..

Don't panic! A fix is on the way!
by croston
Sat Apr 20, 2013 8:22 am
Forum: Python
Topic: RPi.GPIO file descriptor overflow
Replies: 5
Views: 1372

Re: RPi.GPIO file descriptor overflow

I have added a bug report:
http://code.google.com/p/raspberry-gpio ... tail?id=38
I will take a look in the next few days.
by croston
Thu Apr 18, 2013 3:08 pm
Forum: Python
Topic: Can't get debounce to work..
Replies: 13
Views: 5387

Re: Can't get debounce to work..

I'll investigate this this weekend. There is a bug at the moment where bounce handling does not work when your callback function takes longer to execute than the bouncetime specified.
by croston
Mon Apr 15, 2013 10:05 pm
Forum: Python
Topic: RPi.GPIO: how to clear interrupts / events
Replies: 8
Views: 12135

Re: RPi.GPIO: how to clear interrupts / events

Looking at your code and RPi.GPIO's code, I can't spot anything immediately obvious. The switchbounce functionality won't have any effect - your callback routine takes much longer (18 secs) than the switchbounce time of 200ms so it is redundant. There is nothing that would latch the callback event i...
by croston
Mon Apr 15, 2013 8:03 pm
Forum: Python
Topic: RPIO or RPi.GPIO
Replies: 13
Views: 5438

Re: RPIO or RPi.GPIO

I could change wait_for_edge so that you can call it with a list of channels, rather than just one channel. It could return the channel number of the edge that is detected. I will make this change in the next release of RPi.GPIO.
by croston
Mon Apr 15, 2013 7:44 pm
Forum: Python
Topic: RPi.GPIO: how to clear interrupts / events
Replies: 8
Views: 12135

Re: RPi.GPIO: how to clear interrupts / events

Could we see some of your code please? You may have found a bug with the event_detected() function - the switchbounce parameter is not used by the event_detected() mechanism, just the callback mechanism. Switch bounce would appear to 'latch' the flag if you check it too soon after the button press b...
by croston
Mon Apr 15, 2013 6:40 pm
Forum: Python
Topic: RPIO or RPi.GPIO
Replies: 13
Views: 5438

Re: RPIO or RPi.GPIO

I think it's the RPi.GPIO enforced threading for interrupts, and therefore a lack of certainty with about interaction with the main thread, such as waking sleeps etc) Are you aware of the wait_for_edge() or event_detected() functions? These RPi.GPIO functions don't use threads. Examples of how to u...
by croston
Sun Apr 14, 2013 7:40 pm
Forum: Staffroom, classroom and projects
Topic: Installing RPi.Gpio for python
Replies: 27
Views: 34766

Re: Installing RPi.Gpio for python

You can find up-to-date instructions and examples here:
http://code.google.com/p/raspberry-gpio ... i/Examples
by croston
Sun Apr 14, 2013 1:20 pm
Forum: General discussion
Topic: PWM Buzzer with GPIO in Python
Replies: 10
Views: 34922

Re: PWM Buzzer with GPIO in Python

It looks like you are using softfloat Wheezy (armel) rather than Raspbian (armhf). The packages in softfloat Wheezy are not as up to date for RPi as with hardfloat Raspbian. You will have to either change to Raspbian (recommended) or download, build and install RPi.GPIO from source.
by croston
Sun Apr 14, 2013 12:54 pm
Forum: General discussion
Topic: GPIO beginner needs HELP!
Replies: 3
Views: 651

Re: GPIO beginner needs HELP!

Up to date documentation and examples of RPi.GPIO can be found here:
http://code.google.com/p/raspberry-gpio ... i/Examples

Go to advanced search