Go to advanced search

by ben_nuttall
Fri Jul 01, 2016 7:51 pm
Forum: Python
Topic: using a button long press vs short press
Replies: 4
Views: 2130

Re: using a button long press vs short press

That's right. See http://gpiozero.readthedocs.io/en/lates ... ero.Button

The above example is as simple as it gets!
by ben_nuttall
Fri Jul 01, 2016 7:49 pm
Forum: Beginners
Topic: Choosing a language
Replies: 4
Views: 802

Re: Choosing a language

GPIO Zero supports the SPI protocol and a few SPI devices too. As for user interfaces, you could use PyGame Zero or just PyGame . There are others in Python, such as tkinker and qt... If you want to use C++, there's a great C library called pigpio which is installed by default in Raspbian too. Docum...
by ben_nuttall
Mon Jun 13, 2016 10:49 am
Forum: Beginners
Topic: Easiest programming language for controlling gpio pins
Replies: 10
Views: 4950

Re: Easiest programming language for controlling gpio pins

Python, using the GPIO Zero library would seem to be appropriate. from gpiozero import LED red = LED(4) red.on() GPIO Zero was designed to be the easiest way of programming GPIO devices. It's pre-installed with Raspbian and easy to get started. Just open IDLE (preferably Python 3) and type commands...
by ben_nuttall
Fri May 27, 2016 11:25 am
Forum: Beginners
Topic: using PI zero GPIO pins
Replies: 3
Views: 1835

Re: using PI zero GPIO pins

1. Solder the pins on
2. Refer to http://pinout.xyz
3. Try some simple programs using Python and GPIO Zero (also see this resource)
by ben_nuttall
Thu Apr 21, 2016 12:53 pm
Forum: Beginners
Topic: Connect ADC to raspberry Pi
Replies: 7
Views: 2034

Re: Connect ADC to raspberry Pi

Which ADC is it?

The GPIO Zero library for Python supports multiple ADC chips, such as the MCP3008, which makes the software side really easy to use. See docs and examples.
by ben_nuttall
Tue Apr 05, 2016 4:21 pm
Forum: Weather station
Topic: Tweeting a daily summary?
Replies: 10
Views: 2153

Re: Tweeting a daily summary?

We have a learning resource for sending tweets (and photo tweets) with Python using Twython!

https://www.raspberrypi.org/learning/tweeting-babbage/
by ben_nuttall
Fri Mar 11, 2016 9:55 pm
Forum: General discussion
Topic: Raspberry Pi Website Loads
Replies: 4
Views: 683

Re: Raspberry Pi Website Loads

Kratos wrote:Here is a strange question: How many times has the Raspberry Pi homepage been visited?

Kratos
Ever, or in a particular period?
by ben_nuttall
Sat Jan 02, 2016 4:46 pm
Forum: Python
Topic: RPi.GPIO sudo versus sudo-less performance differences
Replies: 6
Views: 2694

Re: RPi.GPIO sudo versus sudo-less performance differences

This is a bug with RPi.GPIO that Ben Croston is aware of. We found the issue when developing GPIO Zero, and Dave Jones has been helping to find a fix or it in RPi.GPIO. See my solution to a similar issue from a GPIO Zero user here: https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=129015&p=874...
by ben_nuttall
Sat Jan 02, 2016 4:43 pm
Forum: Python
Topic: button control using gpiozero
Replies: 3
Views: 1737

Re: button control using gpiozero

Unfortunately this is a known bug that resides in RPI.GPIO. See https://github.com/RPi-Distro/python-gpiozero/issues/50 When creating an input device object like Button, it does some setup including edge detection, and we've found that tends to fail on the first attempt (annoyingly), but not the sec...
by ben_nuttall
Sat Jan 02, 2016 4:35 pm
Forum: Beginners
Topic: No access to DEV/MEM
Replies: 9
Views: 2321

Re: No access to DEV/MEM

The new Jessie image contains the fix to make GPIO work without sudo, and also comes with GPIO Zero pre-installed.

Grab it from the downloads page
by ben_nuttall
Sat Jan 02, 2016 4:16 pm
Forum: General discussion
Topic: New to Raspberry Pi. Help with programming GPIO pins
Replies: 2
Views: 872

Re: New to Raspberry Pi. Help with programming GPIO pins

First of all, you'd better test the LED works without worrying that your code is wrong. Try connecting it to GND and 3V3 to see if it comes on. 3V3 is basically a GPIO pin that's always on. If you can't get it to come on that way, your LED is probably broken. Assuming your LED does work, perhaps you...
by ben_nuttall
Sat Jan 02, 2016 4:05 pm
Forum: General discussion
Topic: module gpiozero doesn't exist apparently
Replies: 20
Views: 12531

Re: module gpiozero doesn't exist apparently

Guys, I assume you're using Raspbian Wheezy - unfortunately the package is yet to be added to Wheezy but you'll find it in the Jessie repos and it comes pre-installed with the Jessie image available from the downloads page.

Update: GPIO Zero now works fine in Raspbian Wheezy.
by ben_nuttall
Fri Jan 01, 2016 4:13 pm
Forum: Troubleshooting
Topic: AVCONV syntax - missing code
Replies: 4
Views: 1857

Re: AVCONV syntax - missing code

I've fixed the worksheet - the avconv command was missing the word "frame".

It could do with more explanation too. Will return to it when I get chance.
by ben_nuttall
Mon Nov 30, 2015 9:24 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RTC not maintaining time on reboot
Replies: 3
Views: 691

Re: RTC not maintaining time on reboot

Disabling ntp seemed to have done the trick.

Code: Select all

sudo update-rc.d ntp disable
by ben_nuttall
Mon Nov 30, 2015 7:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RTC not maintaining time on reboot
Replies: 3
Views: 691

RTC not maintaining time on reboot

I've installed an RTC, the sd1307, removed the fake-hwclock package and added dtoverlay=i2c-rtc,ds1307 to my config.txt. I can successfully write to the clock, then read it. However, after a reboot, trying to read the clock gives the following error: hwclock: The Hardware Clock registers contain val...
by ben_nuttall
Mon Oct 05, 2015 10:43 pm
Forum: Python
Topic: how to name pictures and skip delay in picamera
Replies: 2
Views: 1803

Re: how to name pictures and skip delay in picamera

We have a learning resource for exactly this project. See Push Button Stop Motion . The gist of the code is: with picamera.PiCamera() as camera: camera.start_preview() frame = 1 while True: GPIO.wait_for_edge(button, GPIO.FALLING) camera.capture('/home/pi/animation/frame%03d.jpg' % frame) frame += 1...
by ben_nuttall
Thu Oct 01, 2015 11:18 am
Forum: Python
Topic: GPIO Zero - a new Python library designed for education
Replies: 6
Views: 6107

Re: GPIO Zero - a new Python library designed for education

Good point. Thanks! Are you referring to generic output devices? We have domain-specific aliases for things like Button where "is_active" becomes "is_pressed" and "is_inactive" becomes "is_released". Would make sense for things like LEDs which have on/off state.
by ben_nuttall
Thu Oct 01, 2015 10:35 am
Forum: Python
Topic: GPIO Zero - a new Python library designed for education
Replies: 6
Views: 6107

GPIO Zero - a new Python library designed for education

[Cross-posted from the Education sub-forum] I've been working on a new Python library that provides a simple interface to everyday GPIO components. It sits on top of the standard RPi.GPIO but requires much less code to get going. It's called GPIO Zero. Simple example: from gpiozero import LED, Butto...
by ben_nuttall
Thu Oct 01, 2015 10:34 am
Forum: Staffroom, classroom and projects
Topic: GPIO Zero - a new Python library designed for education
Replies: 7
Views: 5676

GPIO Zero - a new Python library designed for education

Dear teachers and educators I've been working on a new Python library that provides a simple interface to everyday GPIO components. It sits on top of the standard RPi.GPIO but requires much less code to get going. It's called GPIO Zero. Simple example: from gpiozero import LED, Button led = LED(2) b...
by ben_nuttall
Wed Sep 02, 2015 1:38 pm
Forum: General discussion
Topic: A Minor Annoyance
Replies: 2
Views: 628

Re: A Minor Annoyance

Are you referring to Raspbian, or the third party images? If Raspbian, I suggest you bookmark raspberrypi.org/downloads/raspbian or just click through from Downloads (only two clicks from the homepage). If third party - we don't have that information as they're hosted elsewhere. Note the changes wer...
by ben_nuttall
Mon Aug 03, 2015 4:23 pm
Forum: Gaming
Topic: Minecraft Pi installed, but no mcpi folder
Replies: 44
Views: 12823

Re: Minecraft Pi installed, but no mcpi folder

We added Python 3 support a couple of months ago. Run

```bash
sudo apt-get update
sudo apt-get upgrade
```

from the Terminal and you'll have the Python 3 version too.

Go to advanced search