Tag Archives: Python

Updates to Minecraft Documentation – and a Python 3 version is on the way!

via Raspberry Pi

No … we’re not adding a Start Menu or a paperclip assistant. This update has nothing to do with Microsoft’s acquisition of Mojang. See the note below for information about this.

mcpi-game

You may remember when Mojang released Minecraft: Pi edition for free on Raspberry Pi back in early 2013. If you’re unfamiliar, Minecraft is a popular sandbox open world-building game (like on-screen lego) available for a number of different platforms like PCs, consoles and phones. The Pi edition has a Python programming interface allowing users to use code to build things and manipulate the virtual world around them. It’s a great way to learn coding, and there are plenty of great projects out there people have done and shared with the world.

mcpi-flying

Last week when we announced the release of the new Raspbian image, we mentioned that Minecraft is now installed by default. Now if you download NOOBS or the standalone Raspbian image, it will come with Minecraft pre-installed. It’s also worth mentioning that the Minecraft application is packaged, so rather than downloading the zip file you can easily install it like a standard application:

sudo apt-get update
sudo apt-get install minecraft-pi

The accompanying Python module will be installed globally along with the game itself you don’t need to save your Python scripts in a particular folder like you did before. If you’re following books, guides, tutorials or worksheets that were written before, the code will still work the same and if you install Minecraft the new way you’ll be able to save your scripts anywhere.

Once it’s installed, here’s the basic setup to get a “Hello world” in Minecraft:

from mcpi import minecraft

mc = minecraft.Minecraft.create()

mc.postToChat("Hello world")

mcpi-idle

When we launched the new Raspberry Pi website in April it came with a documentation section, which we’ve been expanding ever since. In May we announced the usage guides within this documentation were complete, which feature basic how to guides for using each of the main applications on Raspberry Pi.

We’ve just revamped the Minecraft section to explore more of the fundamental components of the Pi edition and its programming interface, including installation, running the game and Python side-by-side, exploring the programming interface and getting a good all-round introduction to what can be done.

You’ll also find this guide in our resources section.

mcpi-tnt-explode

The edition we have at the moment was built for Python 2, and that’s still the case. However, the education team brought this up at PyConUK at the weekend and a team of developers offered to work on porting it to Python 3 – with some success!

IMG_20140922_114131.resized

The project is on GitHub and you can download the repository and use it the way you would use the old version of Minecraft (when you downloaded a zip) if you want to test it – just use IDLE 3 instead! We’re also planning to make some improvements to the API to make it more Pythonic and more intuitive. I’m not sure what the timescale will be for the port, but watch this space for news.

Python 3 is really important to us and we’re keen to make sure all libraries people use on the Pi are available in Python 3. Python 2 should not be the default, we should be pushing forward and adapting Python 3. As it says on the Python 2 or Python 3 page on python.org:

Short version: Python 2.x is legacy, Python 3.x is the present and future of the language
python.org

So if you’re the maintainer of a Python library, please help by making sure it’s available for Python 3. If you’re using a Python library that’s not available in Python 3 – please let us know so we can add it to the list and we’ll do what we can do get them ported.

One last note about the Microsoft acquisition of the Minecraft development company Mojang: many people have asked us what this means for the future of Minecraft on Raspberry Pi. In statements on their website, Microsoft claim they intend to continue to support Minecraft on all existing platforms. We don’t know for sure what the future will bring but Minecraft is important to us, particularly its use in education, and we’re confident that it won’t be taken from us.

Snakes and Ladders, Pi style

via Raspberry Pi

Les Pounder is a big player in the Linux & free software community in the North West. I first met him a few years ago when he was running Barcamp Blackpool, Blackpool GeekUp, Oggcamp in Liverpool, UCubed (Ubuntu & Upstream Unconference) in Manchester plus Linux user groups and other events. When I set up the Manchester Raspberry Jam in 2012, it was modelled on the style of a UCubed event – and Les came along to help out.

Les was working as a systems administrator around the time the Pi came out. Within a year or so of the community blossoming and his involvement growing, he decided to embark on a new career with the Pi at its heart. He got some work running CPD for teachers, introducing them to the Pi and to coding, he started writing articles for Linux Format, he started putting Raspberry Pi projects together for Element14, and since Linux Voice began he’s been contributing articles and Pi tutorials for them. He’s also currently working on a book with Wiley on Raspberry Pi & Arduino projects.

Les recently set up the Blackpool Raspberry Jam – and at their inaugural event he demonstrated a new project he made which brings the traditional board game Snakes and Ladders in to the digital world of IO with the Model B+. It’s called Pythons and Resistors. Over to Les:

For this project we will look back to our childhood and bring a much loved game from our past into the future. The humble board game.

les1

Board games have been a traditional family pastime for many generations but with the rise of computer games their novelty has started to dwindle. These card and paper based games have little to offer the children of today who have been brought up on a diet of downloadable content packs and gamer scores.

But what if we could take a game from yesteryear and adapt it using the Raspberry Pi?

Meet the latest interactive board game: Pythons and Resistors.

board

The board game is based on a simple snakes and ladders setup, with 100 squares in total via a grid of 10 x 10 squares. The object of the game is for 2 or more players to roll a dice and move their game piece to match the number given on the dice. If the player lands on a python’s head, then they will slither down the game board to the tail of the Python. If the player lands on the bottom of a resistor then they will climb up the game board. The winner is the first player to reach square 100, which is at the top left of the board.

dice_LED

 

gpio

See the full tutorial in the Element 14 community and see the final code on Les’s GitHub.

World Maker Faire and PyConUK

via Raspberry Pi

It’s been quiet around Pi Towers lately. Quiet and disquieting, rather like standing in your nan’s best front room when you were a kid and really needing a wee but were too afraid to break the silence. But we have good and exciting reasons for our quietude: we’ve all been busy preparing for two of our biggest events of the year. This weekend the education team is spreading it’s feelers of learning goodness around the world, from the Midlands to East Coast America.

world-maker-faire

Carrie Anne, Dave and Ben are at PyConUK while Rachel and I, along with James (our Director of Hardware), were beaten with a sock full of oranges until we sobbingly agreed to go to World Maker Faire New York.

The Maker Faire contingent will be joining our friends on the Pimoroni stand, demoing all sorts of goodies both new and old; selling shiny swag; giving out freebies; and talking and talking until we cough our larynxes into our fifteenth cup of Joe (as my American-English dictionary tells me I should call coffee if I want to be street).

2014-09-19 10.31.31

New swag bags! Grab ‘em while they’re hot

Our director of hardware engineering James Adams will be there – he’s giving a talk on What’s next at Raspberry Pi? on [Saturday at 2.30pm according to this / Sunday 2pm according to this] in the NYSCI Auditorium – and Rachel and I will be speaking about digital creativity (details TBA). If you are at Maker Faire do come and visit us. At Maker Faire Bay Area earlier this year it was great to see so many educators and I hope to speak to at least as many in New York. But whatever your interests in Raspberry Pi – from digital creativity to hardware to making stuff (of course!) – we would love to see you.

If you can’t make it to New York, here’s a Q&A Make’s Matt Richardson conducted with James:

Meanwhile in Coventry Carrie Anne, Ben, Dave and Alex are running Python workshops, giving talks about Raspberry Pi in education and chatting to teachers, educators and developers in the Python community.

pyconuk

pyconuk2

Raspberry Pi team hard at work

Controlling electrical sockets with Energenie Pi-mote

via Raspberry Pi

Last Christmas I decided I had spent enough time bending over the various chairs to reach the switch to turn on and off the Christmas tree lights. So I bought a set of Energenie remote-controlled mains switches.

I decided that this would be a great device to wire up to the Raspberry Pi, because I could then program the Pi to control my Christmas lights during the day. Unfortunately, the small remote control supplied with the distribution board does not have any mechanism of external control.  So I got in contact with Energenie, the manufacturers of these great devices, to invite them over to Pi Towers and show them what a great thing Raspberry Pi is and why they should create a Raspberry Pi add-on to be able to control the devices…

A couple of months later I get a visit from their team, who showed me the results of quite a bit of engineering (and a little fun I think):

pimote

A little bit of information from the guys at Energenie:

The Pi-mote control is an add on board that permits control of 433mHz radio controlled electrical sockets. Easy to install and command, the product provides a simple and safe way to add control of mains powered devices and appliances to your Raspberry Pi.

Energenie make a range of compatible sockets which can be operated by Pi-mote control. If you already own Energenie sockets, these are backwards compatible with Pi-mote Control.

A starter kit is available which includes the Pi-mote Control and 2 13Amp electrical sockets for use in standard UK 3-pin mains sockets. Some Python code to enable simple on-off control of these sockets will get you going out of the box.

While Amy Mather was in the office earlier in the year to do some work experience, I asked her to think of something she could do with the system and to write some code to prettify the existing Python code. She started by writing a basic function to control power sockets using some binary logic, and proceeded to hack one of the built-in Python games in Raspbian to make it play a song and turn on some disco lights when the player wins the game. Cue the music:

…finally Rick-Rolled the Raspberry Pi blog!

See Amy’s example code and the modified memory puzzle game on her GitHub.

The basic usage for Amy’s energenie module looks like this:

from energenie import switch_on, switch_off
from time import sleep

# turn a plug socket on and off by number
switch_on(1)
switch_off(1)

switch_on(3)
switch_off(3)

# turn all plug sockets on and off
switch_on(0)
switch_off(0)

# turn some plug sockets on, then turn them off after 10 seconds
switch_on(1)
switch_on(4)
sleep(10)
switch_off(1)
switch_off(4)

Want to control something simple from your Pi? Washing machine, Vacuum cleaner, liquidiser (create your own cat scarer):

Buy yours at energenie4u.co.uk!

Boris, the Twitter Dino-Bot

via Raspberry Pi

UK teachers: want two days of free, top-class CPD? Check out Picademy, and send us your applications!

What do you get if you cross a PiFace with a rubber dinosaur from Marks and Spencer?

Twitter magic, that’s what.

Teacher Dan Aldred has come up with a thing of beauty: a hack that makes your desktop dinosaur roar whenever it’s mentioned on Twitter. (What do you mean, you don’t have a desktop dinosaur?)

Boris, scaring the living bejezus out of all comers.

Boris, scaring the living bejezus out of all comers.

The build itself is simple enough – you can do the same with any kids’ toy that uses a button or switch to make a noise. Dan built a bridge across Boris’s switch using tin foil, our favourite hacker tool. He hooked Boris up to the PiFace GPIO expansion board (the PiFace site is currently the only site on the internet that features a picture of me crouching like a preying mantis in a cardigan on its front page), got Python talking to the Twitter API and wrote a simple program to tell Boris to roar whenever the string “ROAR” is tweeted at Dan’s account. All very easy, but the results are magic.

Boris, innards exposed.

Boris, innards exposed.

Here’s Boris in action:

You can send Dan a tweet yourself – he’s @Dan_Aldred. (Just think! If enough of you tweet “Roar” at him, he’ll either be driven mad or forced to power Boris down.) We love it, Dan. Boris is a thing of beauty, and a great learning exercise. Dan has made full instructions and all the (very simple) Python you’ll need available at his website: if you’ve got some time this weekend and are in charge of a bored child, I can’t think of a better way to spend a couple of hours.

Minecraft Pi recipe cards to download and keep

via Raspberry Pi

We think Craig Richardson’s brilliant. His Python Programming for Raspberry Pi book (available as a free download) remains one of the very best tools for stealthily teaching rigorous and useful computing concepts and programming tricks to kids that we’ve seen. Kids love Craig’s resources (we’ve found it hard to make them stop working and pack up to go home when we’ve run Craig’s bag of tricks in workshops); and whether you’re a teacher, a parent or an interested learner of any age, you’ll find something in there to get your teeth into.

Craig’s Minecraft resources will be available to buy in print later in the year (we know a lot of you prefer to have textbooks and other reference material available as a dead-tree book). Speaking of dead trees, Craig’s preferred method of teaching times tables is to get kids fighting Minecraft trees. It goes down about 1000% better than number squares.

Not prepared to stop at one giant tome of Minecraft goodness, Craig is working on new materials all the time: his latest batch is a set of recipe cards for workshops or the classroom, which we used at the first Picademy for teachers.

Recipe card

 

Craig says:

Minecraft: Pi Edition has huge potential for engaging people with programming. The Minecraft game is hugely popular with children and adults alike, as it allows enormous creativity. Combining it with Python programming on the Raspberry Pi opens up an even greater level of creative freedom, and is a massive incentive for learning to program.

Following on from the first draft of my Python Programming with Minecraft Pi book, I developed a set of recipe cards.

The recipe cards provide short example Python programs that interact with Minecraft Pi. They are designed to be accessible for complete beginners. Each recipe card teaches the basics of a programming concept, such as variables or loops, and includes detailed explanations of how the code works.

When using the recipe cards to teach programming in workshops I’ve found that it is essential to leave scope for creativity. Having the opportunity to play and incorporate their own ideas into their programs is hugely beneficial for adults and children. It is more engaging than just copying code and helps develop a deeper understanding when they’re learning to program.

Creative freedom is one of the reasons that Minecraft is so popular, which is why it complements learning to program perfectly.

He’s right, too.

Several of you asked for a downloadable version of these cards when you saw the photographs from Picademy, so Craig has made them available on his website. Thanks so much Craig – we’re looking forward to seeing what comes next!

 

 

Upgrading the OpenWrt-Yun image on the Yún

via Arduino Blog

ArduinoYun_orizz

Today we released the upgraded version of the OpenWrt-Yun image on the Arduino Yún.
This version includes all the latest and greatest from stable OpenWrt, the latest (Python) Bridge (with a php contribution and fixes to the file module), we also added Mailbox support to REST api and other fixes to some open issues.

The new image contains also the fix to the well known Heartbleed bug, a big security issue that impacted on almost all websites of the world.

If you own an Arduino Yún we suggest you to follow the link and read the procedure to update the board.
You’ll need to download the zip file from the download page. Remember that updating the OpenWrt-Yun image will cause the loss of all files and configurations you previously saved on the flash memory of the Yún.
Enjoy!

Mudra: a Braille dicta-teacher

via Raspberry Pi

Sanskriti Dawle and Aman Srivastav are second-year students at the Birla Institute of Technology and Science in Goa. After a Raspberry Pi workshop they decided they wanted to do something more meaningful than just flash LEDs on and off, and set this month’s PyCon in Montreal as their deadline.

team-mudra1

Aman Srivastav and Sanskriti Dawle

They ended up producing something really special. Mudra means “sign” in Sanskrit: the Raspberry Pi-based device is a learning tool for visually impaired people, which teaches Braille by translating speech to Braille symbols. Braille literacy among blind people is poor even in the developed world: in India, it’s extremely low, and braille teachers are very, very few. So automating the teaching process – especially in an open and inexpensive way like this – is invaluable.

In its learning mode, Mudra uses Google’s speech API to translate single letters and numbers into Braille, so learners can go at their own speed. Exam modes and auto modes are also available. This whole video is well worth your time, but if you’re anxious to see the device in action, fast-forward to 1:30.

Sanskriti and Aman say:

Mudra is an excellent example of what even programming newbies can achieve using Python. It is built on a Raspi to make it as out-of-the-box as possible. We have close to zero coding experience, yet Python has empowered us enough to make a social impact with Mudra, the braille dicta-teacher, which just might be the future of Braille instruction and learning.

We think Mudra’s a real achievement, and a great example of clean and simple ideas which can have exceptional impact. You can see the Mudra repository on GitHub if you’d like a nose around how things work; we’re hoping that Sanskriti and Aman are able to productise their idea and make it widely available to people all over the world.

Learning Python with Raspberry Pi

via Raspberry Pi

If you’ve been round here for any length of time, you’ve probably heard mention of Alex Bradbury. Alex is currently polishing off his PhD thesis at the Computer Lab at the University of Cambridge, and he’s been involved with the Raspberry Pi project as a volunteer from our very early days, back when all we had was alpha development boards. Alex is responsible for building and releasing Raspberry Pi’s Raspbian OS images, and maintaining our Debian repository in his (limited) spare time.

He’s somehow also found the time to write a book with Linux Voice‘s Ben Everard.

Learning Python with Raspberry Pi doesn’t presuppose any computing knowledge, and takes you from a standing start through variables, loops and functions, 3D graphical programming, building games, networking, scripting, interfacing with hardware…and, of course, Minecraft. There’s much more besides: if you work your way through the whole book you’ll be building robots and alarm systems; manipulating sound and video; and learning how to test and debug the Bradbury and Everard way.

As well as what you’ll find in the book, Alex and Ben have made a large code repository available to complement the information and instructions in Learning Python with Raspberry Pi: you’ll be able to download what you need free of charge.

Alex says:

Ever since the introduction of the Raspberry Pi, Python has been touted (with good reason) as the language of choice for anyone wanting to program on the device. Reasonable people can disagree on the ultimate reasons for Python’s success, but I think we can all recognise what an asset its large and friendly community is, as well as the value of its extensive collection of high quality libraries for helping to solve almost any programming task.

Learning Python with Raspberry Pi aims to teach the reader the Python they need to make their Raspberry Pi project ideas a reality. We give lots of examples in the sort of areas likely to be of interest to the Pi community – including physical computing, audio and video, 3d graphics, Minecraft programming, and games.  Another important aspect for us is that every chapter ends with a whole host of ideas and pointers on what you’re now able to do given what you’ve just learnt. Python is the single most useful language to know for the Raspberry Pi, and I like to think that with Learning Python with Raspberry Pi, we’ve managed to produce an entertaining and educational introduction to it. Hopefully you agree!

Learning Python with Raspberry Pi is available from Amazon, and from a good book shop near you: we hope to be stocking it in the Swag Store soon too.

 

 

Raspberry Pi Projects: a big book by Andrew Robinson and Mike Cook

via Raspberry Pi

Ben here – Liz is currently non-functional due to her body having no idea what time it was when she arrived at the office this morning after landing back from San Francisco at the weekend.

Raspberry Pi Projects is a fantastic book from Wiley, the publishers of Eben and Gareth’s Raspberry Pi User Guide and Carrie Anne’s Adventures in Raspberry Pi. It’s written by two great Pioneers: Dr. Andrew Robinson (creator of PiFace) and Mike Cook (co-author of Raspberry Pi for Dummies and creator of many awesome hardware projects).

The book comprises of 16 practical software and hardware projects for the Raspberry Pi – all put together and documented by Andrew and Mike (with help) that are designed to help you better understand the system and become more confident in development of a range of projects. The projects are handily presented in rough order of difficulty, starting with the easier ones to get you going – and move on to more complex ones.

The book covers interactive text based games in Python, graphical games with PyGame, interactive game hardware, application with PiFace Digital, making a toy chicken send tweets, chaotic pendulum hamonographs, car racing and more – as well as a chapter on Minecraft by Sean McManus, and Home Automation by Jonathan Evans.

I wrote on here recently about things you can do with your Raspberry Pi – and this book is crammed full of amazing examples. Books like this and Carrie Anne’s will guide you through a given project and provide you with learning points along the way, which is a great way to learn about Linux, Python, hardware hacking or anything. Beginner or not you’ll learn lots by following the guide set out by experts such as these.

Here are some examples of the projects Mike put together:

PacMan made in Python PyGame:

Disco lights:

See more previews of the contents of the book on Mike’s blog!

Raspberry Pi Projects is available from Amazon and also as a two-part e-book from Wiley: Part 1 & Part 2

Graphic equaliser

via Raspberry Pi

Our good friends at Adafruit put this project on their Learning System earlier this month. It’s a beaut: you’ll learn something making it, and it looks fantastic when set up. Before we get into the nitty gritty, here’s some video:

This graphic equaliser (a spectrum analys/zer if you’re from the USA) is made from a RGB led strip, with everything down to the audio processing run on the Pi. Everything you see in the video is happening in real time. The setup runs Python, and is based on LightShowPi (which was originally designed to orchestrate Christmas lights), so you’ll be able add LightShowPi features like SMS control from your phone if you’re an advanced user.

Some soldering is required – but soldering is easy, and this is a good project to earn your soldering wings on if you haven’t already. There’s the usual full and helpful tutorial over at Adafruit, along with tips, a parts list, code and all that good stuff. I wish I’d had one of these for my student bedroom. Imagine the parties!

Embedded Scripting (Lua, Espruino, Micro Python)

via OSHUG

The thirty-second OSHUG meeting will take a look at the use of scripting languages with deeply embedded computing platforms, which have much more constrained resources than the platforms which were originally targeted by the languages.

Programming a microcontroller with Lua

eLua is a full version of the Lua programming language for microcontrollers, running on bare metal. Lua provides a modern high level dynamicaly typed language, with first class functions, coroutines and an API for interacting with C code, and yet which is very small and can run in a memory constrained environment. This talk will cover the Lua language and microcontroller environment, and show it running on-off-the-shelf ARM Cortex boards as well as the Mizar32, an open hardware design built especially for eLua.

Justin Cormack is a software developer based in London. He previously worked at a startup that built LED displays and retains a fondness for hardware. He organizes the London Lua User Group, which hosts talks on the Lua programming language.

Bringing JavaScript to Microcontrollers

This talk will discuss the benefits and challenges of running a modern scripting language on microcontrollers with extremely limited resources. In particular we will take a look at the Espruino JavaScript interpreter and how it addresses these challenges and manages to run in less than 8kB of RAM.

Gordon Williams has developed software for companies such as Altera, Nokia, Microsoft and Lloyds Register, but has been working on the Espruino JavaScript interpreter for the last 18 months. In his free time he enjoys making things - from little gadgets to whole cars.

Micro Python — Python for microcontrollers

Microcontrollers have recently become powerful enough to host high-level scripting languages and run meaningful programs written in them. In this talk we will explore the software and hardware of the Micro Python project, an open source implementation of Python 3 which aims to be as compatible as possible with CPython, whilst still fitting within the RAM and ROM constraints of a microcontroller. Many tricks are employed to put as much as possible within ROM, and to use the least RAM and minimal heap allocations as is feasible. The project was successfully funded via a Kickstarter campaign at the end of 2013, and the hardware is currently being manufactured at Jaltek Systems UK.

Damien George is a theoretical physicist who likes to write compilers and build robots in his spare time.

Note: Please aim to by 18:15 as the first talk will start at 18:30 prompt.

Sponsored by:

A pure Python interface for the camera module: meet picamera!

via Raspberry Pi

If you have a Raspberry Pi camera module, you’ve probably used raspistill and raspivid, which are command line tools for using the camera. Dave Jones, a Database Admin, software developer and SQL know-it-all based in Manchester has been working on an equivalent, feature complete implementation of these in Python. This means you can access the camera module directly from a Python script, without using os.system or executing a subprocess.

At Oggcamp I set up a big TV with a Pi and camera taped on top. I SSH’d in to the Pi from my laptop and entered commands in to iPython using picamera.

Speaking as an avid Pythonist, picamera’s implementation is beautiful and it really is a wonderful library to use. It works really well for demonstrations using the Pi camera, and for real world applications. Part of the appeal of the Raspberry Pi is that you can work on embedded electronics projects without needing to know low-level languages or have to program a microprocessor – instead you have the choice of a range of accessible high-level languages such as Python – and this is an extension of that kind of abstraction, which open up a world of possibilities to a wider diversity of makers.

Example usage:

import picamera
from time import sleep

camera = picamera.PiCamera()
camera.capture('image.jpg')

camera.start_preview()
camera.vflip = True
camera.hflip = True
camera.brightness = 60

camera.start_recording('video.h264')
sleep(5)
camera.stop_recording()

Also you can do things like this:

for i in range(100):
    camera.brightness = i
    sleep(0.1)

and watch the preview flow through the brightness levels.

The library has many configurations – you can change the brightness, contrast, saturation, image effects, exposure modes and such, as well as optionally show a live preview of the camera’s view. You can capture single images and sequences of images as well as video streams.

Here’s a presentation of picamera Dave gave at Manchester Raspberry Jam XVI – where he demonstrates the basic usage of the module by typing commands in to a Python prompt on his laptop, with a monitor displaying the camera output (unfortunately out of shot in the video):

Dave’s wife Holly works in the Palaeontology department at Manchester University (Interesting fact: when Dave and Holly got married, they picked a new surname to take (Dave was previously a Hughes) – so Holly could become Dr. Jones, and he would become Davy Jones) where they regularly capture images from microscopes. Rather than mount a huge camera on top of a microscope, Dave suggested attaching the Pi’s camera module to the lens.

An early version of the crudely mounted Picroscope

He ended up writing a web app to support its use. This allows the user to control camera configuration settings through a web page, and capture photographs at the click of a button, as well as archive pictures taken in to a database along with metadata and extra information entered in a web form.

The web app showing pictures taken (smaller field of view due to temporary mounting setup)

Single view of image taken through the web app, with metadata fields

Picroscopy configuration settings

Dave gave another presentation at the Manchester Jam, this time demonstrating a simple version of a Python web app for such an application (please excuse the numerous technical hiccups):

As Dave says in the video:

“This is where having a library is particularly useful. If we were doing this with, say, raspistill and raspivid, when you want to alter the brightness of your preview, you’d have to shut down the program, regenerate the command line, restart the program. Here we’re just saying “set a property”. This is why a library is better for an interactive application like this. There’s nothing wrong with raspistill and raspivid as far as they go, but they’re not ideal for building this sort of application. If you have interactivity, you want a library.”

See more videos from the Manchester Jam: Jam #16 Videos.

picamera has been available in pypi since October (v0.5), so it’s already in the wild – but now it’s hit the v1.0 milestone Dave considered feature complete, it’s packaged in the Raspbian archives so you install with apt-get (remember to run apt-get update first):

apt-get install python-picamera

or

apt-get install python3-picamera

depending on your taste.

Dave also mentioned to me that this is by far the most popular project he’s ever published – and he’s been impressed by how brilliant the feedback has been from the Pi community. He’s had a great response on the forums, detailed bug reports provided by users and plenty of help from James Hughes, the author of raspistill, and from Alex Bradbury in getting it packaged for Raspbian.

See the source for picamera and the picroscopy web app on github. Thanks to Dave for his hard work in building this library. Enjoy!

Wireless Encryption Between Galileo and a MSP430

via Hack a Day» hardware

[Mark] recently finished his latest project, where he encrypts wireless communications between the new Intel Galileo and a Texas Instruments MSP430. The wireless interfaces used are the very common nRF24L01+ 2.4GHz transceivers, that had a direct line of sight 15 feet range during [Mark]‘s tests. In his demonstration, the MSP430 sends an encrypted block of data representing the state of six of its pins configured as inputs. This message is then received by a sketch running on the Galileo and stored in shared memory. A python script then wakes up and is in charge of decrypting the message. The encryption is done using AES-128bits in Electronic Codebook mode (ECB) and semaphores are used to prevent simultaneous accesses to the received data. As it is the first project using an Intel Galileo we received, don’t hesitate to send us a tip if you found other ones.


Filed under: hardware, Microcontrollers

PyPy 2.1 beta released

via Raspberry Pi

Back in May, we mentioned that we’d been sponsoring the development of the ARM port of PyPy, the high-performance Python interpreter. Earlier today the team released a first beta of the upcoming 2.1 release, which for the first time adds ARM as an officially supported architecture.

You can see the announcement here, and download binaries for Raspbian here. Give it a spin and let us know what you think.