European Astro Pi Challenge: Mission Space Lab winners 2018–2019!

This is your periodic reminder that there are two Raspberry Pi computers in space! That’s right — our Astro Pi units Ed and Izzy have called the International Space Station home since 2016, and we are proud to work with ESA Education to run the European Astro Pi Challenge, which allows students to conduct scientific investigations in space, by writing computer programs.

Astro PI IR on ISS

An Astro Pi takes photos of the earth from the window of the International Space Station

The Challenge has two missions: Mission Zero and Mission Space Lab. The more advanced one, Mission Space Lab, invites teams of students and young people under 19 years of age to enter by submitting an idea for a scientific experiment to be run on the Astro Pi units.

ESA and the Raspberry Pi Foundation would like to congratulate all the teams that participated in the European Astro Pi Challenge this year. A record-breaking number of more than 15000 people, from all 22 ESA Member States as well as Canada, Slovenia, and Malta, took part in this year’s challenge across both Mission Space Lab and Mission Zero!

Eleven teams have won Mission Space Lab 2018–2019

After designing their own scientific investigations and having their programs run aboard the International Space Station, the Mission Space Lab teams spent their time analysed the data they received back from the ISS. To complete the challenge, they had to submit a short scientific report discuss their results and highlight the conclusions of their experiments. We were very impressed by the quality of the reports, which showed a high level of scientific merit.

We are delighted to announce that, while it was a difficult task, the Astro Pi jury has now selected eleven winning teams, as well as highly commending four additional teams. The eleven winning teams won the chance to join an exclusive video call with ESA astronaut Frank De Winne. He is the head of the European Astronaut Centre in Germany, where astronauts train for their missions. Each team had the once-in-a-lifetime chance to ask Frank about his life as an astronaut.

And the winners are…

Firewatchers from Post CERN HSSIP Group, Portugal, used a machine learning method on their images to identify areas that had recently suffered from wildfires.

Go, 3.141592…, Go! from IES Tomás Navarro Tomás, Spain, took pictures of the Yosemite and Lost River forests and analysed them to study the effects of global drought stress. They did this by using indexes of vegetation and moisture to assess whether forests are healthy and well-preserved.

Les Robotiseurs from Ecole Primaire Publique de Saint-André d’Embrun, France, investigated variations in Earth’s magnetic field between the North and South hemispheres, and between day and night.

TheHappy.Pi from I Liceum Ogólnokształcące im. Bolesława Krzywoustego w Słupsku, Poland, successfully processed their images to measure the relative chlorophyll concentrations of vegetation on Earth.

AstroRussell from Liceo Bertrand Russell, Italy, developed a clever image processing algorithm to classify images into sea, cloud, ice, and land categories.

Les Puissants 2.0 from Lycee International de Londres Winston Churchill, United Kingdom, used the Astro Pi’s accelerometer to study the motion of the ISS itself under conditions of normal flight and course correction/reboost maneuvers.

Torricelli from ITIS “E.Torricelli”, Italy, recorded images and took sensor measurements to calculate the orbital period and flight speed of the ISS followed by the mass of the Earth using Newton’s universal law of gravitation.

ApplePi from I Liceum Ogólnokształcące im. Króla Stanisława Leszczyńskiego w Jaśle, Poland, compared their images from Astro Pi Izzy to historical images from 35 years ago and could show that coastlines have changed slightly due to erosion or human impact.

Spacethon from Saint Joseph La Salle Pruillé Le Chétif, France, tested their image-processing algorithm to identify solid, liquid, and gaseous features of exoplanets.

Stithians Rocket Code Club from Stithians CP School, United Kingdom, performed an experiment comparing the temperature aboard the ISS to the average temperature of the nearest country the space station was flying over.

Vytina Aerospace from Primary School of Vytina, Greece, recorded images of reservoirs and lakes on Earth to compare them with historical images from the last 30 years in order to investigate climate change.

Highly commended teams

We also selected four teams to be highly commended, and they will receive a selection of goodies from ESA Education and the Raspberry Pi Foundation:

Aguere Team from IES Marina Cebrián, Spain, investigated variations in the Earth’s magnetic field due to solar activity and a particular disturbance due to a solar coronal hole.

Astroraga from CoderDojo Trento, Italy, measured the magnetic field to investigate whether astronauts can still use a compass, just like on Earth, to orient themselves on the ISS.

Betlemites from Escoles Betlem, Spain, recorded the temperature on the ISS to find out if the pattern of a convection cell is different in microgravity.

Rovel In The Space from Scuola secondaria I grado A.Rosmini ROVELLO PORRO(Como), Italy, executed a program that monitored the pressure and would warn astronauts in case space debris or micrometeoroids collided with the ISS.

The next edition is not far off!

ESA and the Raspberry Pi Foundation would like to invite all school teachers, students, and young people to join the next edition of the challenge. Make sure to follow updates on the Astro Pi website and Astro Pi Twitter account to look out for the announcement of next year’s Astro Pi Challenge!

The post European Astro Pi Challenge: Mission Space Lab winners 2018–2019! appeared first on Raspberry Pi.



Source: Raspberry Pi – European Astro Pi Challenge: Mission Space Lab winners 2018–2019!

Chat to Ada Lovelace via a Raspberry Pi

Our friends, 8 Bits and a Byte, have built a Historic Voicebot, allowing users to chat to their favourite historical figures.

It’s rather marvellous.

The Historic Voicebot

Have a chat with your favourite person from the past with the Historic Voicebot! With this interactive installation, you can talk to a historical figure through both chat and voice. Made using Dialogflow, Node.js, HTML Canvas, an AIY Voice Kit, a Raspberry Pi and a vintage phone.

All the skills

Coding? Check. Woodwork? Check. Tearing apart a Google AIY Kit in order to retrofit it into a vintage telephone while ensuring it can still pick up voice via the handset? Check, check, check – this project has it all.

The concept consists of two parts:

  • A touchscreen with animations of a historical figure. The touchscreen also displays the dialog and has buttons so people can ask an FAQ.
  • A physical phone that captures speech and gives audio output, so it can be used to ask questions and listen to the answer.

While Nicole doesn’t go into full detail in the video, the Ada animation uses Dialogflow, Node.js, and HTML Canvas to work, and pairs up with the existing tech in the Google AIY Kit.

And, if you don’t have an AIY Kit to hand, don’t worry; you can have the same functionality using a standard USB speaker and microphone, and Google Home running on a Raspberry Pi.

You can find a tutorial for the whole project on hackster.io.

Follow 8 Bits and a Byte

There are a lot of YouTube channels out there that don’t have the follow count we reckon they deserve, and 8 Bits and a Byte is one of them. So, head to their channel and click that subscribe button, and be sure to check out their other videos for some more Raspberry Pi goodness.

The post Chat to Ada Lovelace via a Raspberry Pi appeared first on Raspberry Pi.



Source: Raspberry Pi – Chat to Ada Lovelace via a Raspberry Pi

An in-flight entertainment system that isn’t terrible

No Alex today; she’s tragically germ-ridden and sighing weakly beneath a heap of duvets on her sofa. But, in spite of it all, she’s managed to communicate that I should share Kyle‘s Raspberry Pi in-flight entertainment system with you.

I made my own IN-FLIGHT entertainment system! ft. Raspberry Pi

Corsair Ironclaw RGB Gaming Mouse: http://bit.ly/2vFwYw5 From poor A/V quality to lackluster content selection, in-flight entertainment centers are full of compromises. Let’s create our own using a Raspberry Pi 3 B+!

Kyle is far from impressed with the in-flight entertainment on most planes: the audio is terrible, the touchscreens are annoyingly temperamental, and the movie selection is often frustratingly limited. So, the night before a morning flight to visit family (congrats on becoming an uncle, Kyle! We trust you’ll use your powers only for good!), he hit upon the idea of building his own in-flight entertainment system, using stuff he already had lying around.

Yes, we know, he could just have taken a tablet with him. But we agree with him that his solution is way funner. It’s way more customisable too. Kyle’s current rushed prototype features a Raspberry Pi 3B+ neatly cable-tied into a drilled Altoids tin lid, which is fixed flush to the back of a 13.3-inch portable monitor with adhesive Velcro. He’s using VLC Media Player, which comes with Raspbian and supports a lot of media control functions straight out of the box; this made using his mouse and mini keyboard a fairly seamless experience. And a handy magnetic/suction bracket lets him put the screen in the back of the seat in front to the best possible use: as a mounting surface.

As Kyle says, “Is it ridiculous? I mean, yes, obviously it’s ridiculous, but would you ever consider doing something like this?”

The post An in-flight entertainment system that isn’t terrible appeared first on Raspberry Pi.



Source: Raspberry Pi – An in-flight entertainment system that isn’t terrible

Remembering Andy Baker

We are immensely sad to learn of the death, on 1 June, of Andy Baker, joint founder and organiser of the brilliant Cotswold Raspberry Jam. Andy had been suffering from brain cancer.

andy baker pistuffing

Together with co-founder Andrew Oakley, Andy worked incredibly hard to make the Cotswold Jam one of the most exciting Jams of all, with over 150 people of all ages attending its most popular events. He started working with Raspberry Pis back in 2012, and developed a seriously impressive degree of technical expertise: among his projects were a series of Pi-powered quadcopters, no less, including an autonomous drone. Many of us will forever associate Andy with a memorably fiery incident at the Raspberry Pi Big Birthday Weekend in 2016, which he handled with grace and good humour that eludes most of us:

Raspberry Pi Party Autonomous drone demo + fire

At the Raspberry Pi IV party and there is a great demo of an Autonomous drone which is very impressive with only using a Pi. However it caught on fire. But i believe it does actually work.

Andy maintained his involvement with the Raspberry Pi community, and especially the Cotswold Jam, for several years while living with a brain tumour, and shared his skills and enthusiasm with hundreds of others. He was at the heart of the Raspberry Pi community. When our patron, His Royal Highness the Duke of York, kindly hosted a reception at St. James’s Palace in October 2016 to recognise the Raspberry Pi community, Andy joined us to celebrate in style:

Cotswold Jam on Twitter

@ben_nuttall @DougGore @PiStuffing @rjam_chat Cheers, Ben! Fab photo of Prince Andrew being ignored by @davejavupride & Andy Baker @PiStuffing who are too busy drinking… “It’s what he would have wanted…” 🙂 https://t.co/FK7sk1CoDs

Andy suggested that, if people would like to make a donation in his name, they support his local school’s IT department, somewhere else he used to volunteer. The department isn’t able to accept online donations, but cheques in pounds sterling can be made out to “Gloucestershire County Council” and posted to a local funeral director who will collect and forward them:

Andy Baker memorial fund
c/o Blackwells of Cricklade
Thames House
Thames Lane
Cricklade
SN6 6BH

We owe Andy immense gratitude for all his work to help people learn and have a great time with Raspberry Pi. We were very lucky indeed to have him as part of our community. We will miss him.

The post Remembering Andy Baker appeared first on Raspberry Pi.



Source: Raspberry Pi – Remembering Andy Baker

Playback your favourite records with Plynth

Use album artwork to trigger playback of your favourite music with Plynth, the Raspberry Pi–powered, camera-enhanced record stand.

Plynth Demo

This is “Plynth Demo” by Plynth on Vimeo, the home for high quality videos and the people who love them.

Record playback with Plynth

Plynth uses a Raspberry Pi and Pi Camera Module to identify cover artwork and play the respective album on your sound system, via your preferred streaming service or digital library.

As the project’s website explains, using Plynth is pretty simple. Just:

  • Place a n LP, CD, tape, VHS, DVD, piece of artwork – anything, really – onto Plynth
  • Plynth uses its built-in camera to scan and identify the work
  • Plynth starts streaming your music on your connected speakers or home stereo system

As for Plynth’s innards? The stand houses a Raspberry Pi 3B+ and Camera Module, and relies on “a combination of the Google Vision API and OpenCV, which is great because there’s a lot of documentation online for both of them”, states the project creator, sp_cecamp, on Reddit.

Other uses

Some of you may wonder why you wouldn’t have your records with your record player and, as such, use that record player to play those records. If you are one of these people, then consider, for example, the beautiful Damien Rice LP I own that tragically broke during a recent house move. While I can no longer play the LP, its artwork is still worthy of a place on my record shelf, and with Plynth I can still play the album as well.

In addition, instead of album artwork to play an album, you could use photographs, doodles, or type to play curated playlists, or, as mentioned on the website, DVDs to play the movies soundtrack, or CDs to correctly select the right disc in a disc changer.

Convinced or not, I think what we can all agree on is that Plynth is a good-looking bit of kit, and at Pi Towers look forward to seeing where they project leads.

The post Playback your favourite records with Plynth appeared first on Raspberry Pi.



Source: Raspberry Pi – Playback your favourite records with Plynth

Ghost hunting in schools with Raspberry Pi | Hello World #9

In Hello World issue 9, out today, Elliott Hall and Tom Bowtell discuss The Digital Ghost Hunt: an immersive theatre and augmented reality experience that takes a narrative-driven approach in order to make digital education accessible.The Digital Ghost Hunt - Raspberry Pi Hello World

The Digital Ghost Hunt combines coding education, augmented reality, and live performance to create an immersive storytelling experience. It begins when a normal school assembly is disrupted by the unscheduled arrival of Deputy Undersecretary Quill of the Ministry of Real Paranormal Hygiene, there to recruit students into the Department’s Ghost Removal Section. She explains that the Ministry needs the students’ help because children have the unique ability to see and interact with ghostly spirits.

The Digital Ghost Hunt - Raspberry Pi Hello World

Under the tutelage of Deputy Undersecretary Quill and Professor Bray (the Ministry’s chief scientist), the young ghost-hunters learn how to program and use their own paranormal detectors. These allow students to discover ghostly traces, translate Morse code using flickering lights, and find messages left in ultraviolet ectoplasm. Meanwhile, the ghost communicates through a mixture of traditional theatrical effects and the poltergeist potential of smart home technology. Together, students uncover the ghost’s identity, discover her reason for haunting the building, unmask a dastardly villain, find a stolen necklace, clear the ghost’s name, right an old wrong, and finally set the ghost free.

The Digital Ghost Hunt - Raspberry Pi Hello World

The project conducted two successful test performances at the Battersea Arts Centre in South London in November 2018, funded by a grant from AHRC’s New Immersive Experiences Programme, led by Mary Krell of Sussex University. Its next outing will be at York Theatre Royal in August.

Adventures in learning

The Digital Ghost Hunt arose out of a shared interest in putting experimentation and play at the centre for learners. We felt that the creative, tinkering spirit of earlier computing — learning how to program BASIC on an Atari 800XL to create a game, for example — was being supplanted by a didactic and prescriptive approach to digital learning. KIT Theatre’s practice — creating classroom adventures that cast pupils as heroes in missions — is also driven by a less trammelled, more experiment-led approach to learning.

We believe that the current Computer Science curriculum isn’t engaging enough for students. We wanted to shift the context of how computer science is perceived, from ‘something techy and boyish’ back to the tool of the imagination that it should be. We did this by de-emphasising the technology itself and, instead, placing it in the larger context of a ghost story. The technology becomes a tool to navigate the narrative world — a means to an end rather than an end in itself. This helps create a more welcoming space for students who are bored or intimidated by the computer lab: a space of performance, experiment, and play.

Ghosts and machines

The device we built for the students was the SEEK Ghost Detector, made from a Raspberry Pi and a micro:bit, which Elliot stapled together. The micro:bit was the device’s interface, which students programmed using the block-based language MakeCode. The Raspberry Pi handled the heavier technical requirements of the show, and communicated them to the micro:bit in a form students could use. The detector had no screen, only the micro:bit’s LEDs. This meant that students’ attention was focused on the environment and what the detector could tell them about it, rather than having their attention pulled to a screen to the exclusion of the ‘real’ world around them.

In addition to the detector, we used a Raspberry Pi to make ordinary smart home technology into our poltergeist. It communicated with the students using effects such as smart bulbs that flashed in Morse code, which the students could then decode on their devices.

To program their detectors, students took part in a series of four lessons at school, focused on thinking like a programmer and the logic of computing. Two of the lessons featured significant time spent programming the micro:bit. The first focused on reading code on paper, and students were asked to look out for any bugs. The second had students thinking about what the detector will do, and acting out the steps together, effectively ‘performing’ the algorithm.

We based the process on KIT Theatre’s Adventures in Learning model, and its Theory of Change:

  • Disruption: an unexpected event grabs attention, creating a new learning space
  • Mission: a character directly asks pupils for their help in completing a mission
  • Achievement: pupils receive training and are given agency to successfully complete the mission

The Ghost Hunt

During these lessons, Deputy Undersecretary Quill kept in touch with the students via email, and the chief scientist sent them instructional videos. Their work culminated in their first official assignment: a ghost haunting the Battersea Arts Centre — a 120-year-old former town hall. After arriving, students were split into four teams, working together. Two teams analysed evidence at headquarters, while the others went out into places in the building where we’d hidden ghostly traces that their detectors would discover. The students pooled their findings to learn the ghost’s story, and then the teams swapped roles. The detectors were therefore only one method of exploring the narrative world. But the fact that they’d learned some of the code gave students a confidence in using the detectors — a sense of ownership. During one performance, one of the students pointed to a detector and said: “I made that.”

Future of the project

The project is now adapting the experience into a family show, in partnership with Pilot Theatre, premiering in York in summer 2019. We aim for it to become the core of an ecosystem of lessons, ideas, and activities — to engage audiences in the imaginative possibilities of digital technology.

You can find out more about the Digital Ghost Hunt on their website, which also includes rather lovely videos that Vimeo won’t let me embed here.

Hello World issue 9

The brand-new issue of Hello World is out today, and available right now as a free PDF download from the Hello World website.

Hello World issu 9

UK-based educators can also sign up to receive Hello World as printed magazine FOR FREE, direct to their door, by signing up here. And those outside the UK, educator or not, can subscribe to receive new issues of Hello World in their inbox on the day of release.

The post Ghost hunting in schools with Raspberry Pi | Hello World #9 appeared first on Raspberry Pi.



Source: Raspberry Pi – Ghost hunting in schools with Raspberry Pi | Hello World #9

Driverless cars run by Raspberry Pi

Could the future of driverless cars be shaped by Raspberry Pi? For undergraduate researchers at the University of Cambridge, the answer is a resounding yes!

Can cars talk to each other?

A fleet of driverless cars working together to keep traffic moving smoothly can improve overall traffic flow by at least 35 percent, researchers have shown. The researchers, from the University of Cambridge, programmed a small fleet of miniature robotic cars to drive on a multi-lane track and observed how the traffic flow changed when one of the cars stopped.

So long, traffic!

By using Raspberry Pis and onboard sensors to program scale-model versions of commercially available cars, undergraduate researchers have built a fleet of driverless cars that ‘talk to each other’. They did this because they are studying how driverless technology can help reduce traffic incidents on our roads.

Cambridge University Driverless cars using Raspberry Pi

The researchers investigated how a car stalled on a multi-lane track affects the buildup of traffic, and how communication between driverless cars can prevent these buildups.

Cambridge University Driverless cars using Raspberry Pi

When the cars acted independently of each other, a stalled car caused other vehicles in the same lane to slow or stop in order to merge into the adjacent lane. This soon led to queues forming along the track. But when the cars communicated via Raspberry Pis, they could tell each other about obstacles on the track, and this allowed cars to shift lanes with the cooperation of other road users.

The researchers recently presented their paper on the subject at the International Conference on Robotics and Automation (ICRA 2019) in Montréal, Canada. You can find links to their results, plus more information, on the University of Cambridge blog.

The post Driverless cars run by Raspberry Pi appeared first on Raspberry Pi.



Source: Raspberry Pi – Driverless cars run by Raspberry Pi

Retrofit a handheld Casio portable TV with a Raspberry Pi

What do we say to the god of outdated tech? Not today! Revive an old portable television with a Raspberry Pi 3!

Pocket televisions

In the late 1980s, when I was a gadget-savvy kid, my mother bought me a pocket TV as a joint Christmas and birthday present. The TV’s image clarity was questionable, its sound tinny, and its aerial so long that I often poked myself and others in the eye while trying to find a signal. Despite all this, it was one of the coolest, most futuristic things I’d ever seen, and I treasured it. But, as most tech of its day, the pocket TV no longer needed: I can watch TV in high definition on my phone — a device half the size, with a screen thrice as large, and no insatiable hunger for AA batteries.

So what do we do with this old tech to save it from the tip?

We put a Raspberry Pi in it, of course!

JaguarWong’s Raspberry Pi 3 pocket TV!

“I picked up a broken Casio TV-400 for the princely sum of ‘free’ a few weeks back. And I knew immediately what I wanted to do with it,” imgur user JaguarWong states in the introduction for the project.

I got the Pi for Christmas a couple of years back and have never really had any plans for it. Not long after I got it, I picked up the little screen from eBay to play with but again, with no real purpose in mind — but when I got the pocket TV everything fell into place.

Isn’t it wonderful when things fall so perfectly into place?

Thanks to an online pinout guide, JW was able to determine how to  connect the screen and the Raspberry Pi; fortunately, only a few jumper wires were needed — “which was handy given the limits on space.”

With slots cut into the base of the TV for the USB and Ethernet ports, the whole project fit together like a dream, with little need for modification of the original housing.

The final result is wonderful. And while JW describes the project as “fun, if mostly pointless”, we think it’s great — another brilliant example of retrofitting old tech with Raspberry Pi!

10/10 would recommend to a friend.

The post Retrofit a handheld Casio portable TV with a Raspberry Pi appeared first on Raspberry Pi.



Source: Raspberry Pi – Retrofit a handheld Casio portable TV with a Raspberry Pi

An opportunity to reach thousands with the Raspberry Pi

Dr Bob Brown is a former professor who taught at Kennesaw State University and Southern Polytechnic State University. He holds a doctorate in computer information systems. Bob is also a Raspberry Pi Certified Educator, and continues to provide exceptional classroom experiences for K-12 students. The moment his students have that “Aha!” feeling is something he truly values, and he continues to enjoy that experience in his K-12 classroom visits.

After retiring from teaching computing in 2017, Bob continued his school visits, first on an informal basis, and later as an official representative of KSU’s College of Computing and Software Engineering (CCSE). Keen to learn more about K-12 Computing, Bob applied to the Raspberry Pi Foundation’s Picademy program, and attended Picademy Atlanta in 2018. Here’s his story of how he has since gone on to lead several Raspberry Pi Teachers’ Workshops, inspiring educators and students alike.

“I couldn’t have done this if I had not attended Picademy” — Bob Brown

“I was amazed at the excitement and creativity that Picademy and the Raspberry Pi created among the teachers who attended,” Bob says. “After reading about the number of applicants for limited Picademy positions, I realized there was unmet demand. I began to wonder whether we could do something similar at the CCSE.”

Bob spent over a hundred hours developing instructional material, and raised over $2,000 from Southern Polytechnic alumni. With the money he raised, Bob conducted a pilot workshop for half a dozen teachers in the autumn of 2018. The workshop was free for participants, and covered material similar to Picademy, but in a one-day format. Participants were also given a Raspberry Pi 3B+ and a parts pack. Bob says, “I couldn’t have done this if I had not attended Picademy and been able to start with the Picademy material from the Raspberry Pi Foundation.”

“[The CCSE] helps improve access, awareness, and sustainability to middle and high school students and teachers.” — Jon Preston

The Dean of CCSE at KSU, Dr Jon Preston, was so impressed with the results of the pilot workshop that he authorised a formal fundraising program and two additional workshops in the spring of 2019. Four more workshops have also been scheduled for the summer.

“The College of Computing and Software Engineering at KSU STEM+Computing project helps improve access, awareness, and sustainability to middle and high school students and teachers. CCSE faculty and undergraduate students build learning materials and deliver these materials on-site to schools in an effort to increase the number of students who are energized by computing and want to study computing to help improve their careers and the world. Given the price and power of the Raspberry Pi computers, these devices are a perfect match for our project in the local schools,” says Preston.

The teachers really enjoyed the workshop, and left incredibly inspired.

Teachers came from all over Georgia and from as far away as Mississippi to attend the workshops. For some of the teachers, it was their first time exploring the concept of physical computing, and the hands-on approach to the workshop helped them set their own pace. The teachers really enjoyed the workshop, and left incredibly inspired. “Teacher workshops have a multiplier effect,” says Brown. “If I teach 30 students, I’ve reached 30 students; if I teach 30 teachers, I potentially reach thousands of students over a period of years.”

Another great contribution to the program was the addition of college student facilitators, who provided individual support to the teachers throughout the day, making it easier for everyone to have the assistance they needed.

By the end of the summer, more than 150 K-12 teachers will have participated in a CCSE Raspberry Pi Teachers’ Workshop.

The Raspberry Pi Teachers’ Workshops have become a regular part of the outreach efforts of the CCSE. Grants from State Farm Insurance, 3M Corporation, and a few very generous individual gifts keep the workshops free for K-12 teachers, who also take home a Raspberry Pi and extra components and parts. Participants are also invited to join an online forum where they can exchange ideas and support each other. By the end of the summer, more than 150 K-12 teachers will have participated in a CCSE Raspberry Pi Teachers’ Workshop. You can find more information about the workshops here.

The post An opportunity to reach thousands with the Raspberry Pi appeared first on Raspberry Pi.



Source: Raspberry Pi – An opportunity to reach thousands with the Raspberry Pi

Coding an isometric game map | Wireframe issue 15

Isometric graphics give 2D games the illusion of depth. Mark Vanstone explains how to make an isometric game map of your own.

Published by Quicksilva in 1983, Ant Attack was one of the earliest games to use isometric graphics. And you threw grenades at giant ants. It was brilliant.

Isometric projection

Most early arcade games were 2D, but in 1982, a new dimension emerged: isometric projection. The first isometric game to hit arcades was Sega’s pseudo-3D shooter, Zaxxon. The eye-catching format soon caught on, and other isometric titles followed: Q*bert came out the same year, and in 1983 the first isometric game for home computers was published: Ant Attack, written by Sandy White.

Ant Attack

Ant Attack was first released on the ZX Spectrum, and the aim of the game was for the player to find and rescue a hostage in a city infested with giant ants. The isometric map has since been used by countless titles, including Ultimate Play The Game’s classics Knight Lore and Alien 8, and my own educational history series ArcVenture.

Let’s look at how an isometric display is created, and code a simple example of how this can be done in Pygame Zero — so let’s start with the basics. The isometric view displays objects as if you’re looking down at 45 degrees onto them, so the top of a cube looks like a diamond shape. The scene is made by drawing cubes on a diagonal grid so that the cubes overlap and create solid-looking structures. Additional layers can be used above them to create the illusion of height.

Blocks are drawn from the back forward, one line at a time and then one layer on top of another until the whole map is drawn.

The cubes are actually two-dimensional bitmaps, which we start printing at the top of the display and move along a diagonal line, drawing cubes as we go. The map is defined by a three-dimensional list (or array). The list is the width of the map by the height of the map, and has as many layers as we want to represent in the upward direction. In our example, we’ll represent the floor as the value 0 and a block as value 1. We’ll make a border around the map and create some arches and pyramids, but you could use any method you like — such as a map editor — to create the map data.

To make things a bit easier on the processor, we only need to draw cubes that are visible in the window, so we can do a check of the coordinates before we draw each cube. Once we’ve looped over the x, y, and z axes of the data list, we should have a 3D map displayed. The whole map doesn’t fit in the window, and in a full game, the map is likely to be many times the size of the screen. To see more of the map, we can add some keyboard controls.

Here’s Mark’s isometric map, coded in Python. To get it running on your system, you’ll first need to install Pygame Zero. And to download the full code, visit our Github repository here.

If we detect keyboard presses in the update() function, all we need to do to move the map is change the coordinates we start drawing the map from. If we start drawing further to the left, the right-hand side of the map emerges, and if we draw the map higher, the lower part of the map can be seen.

We now have a basic map made of cubes that we can move around the window. If we want to make this into a game, we can expand the way the data represents the display. We could add differently shaped blocks represented by different numbers in the data, and we could include a player block which gets drawn in the draw() function and can be moved around the map. We could also have some enemies moving around — and before we know it, we’ll have a game a bit like Ant Attack.

Tiled

When writing games with large isometric maps, an editor will come in handy. You can write your own, but there are several out there that you can use. One very good one is called Tiled and can be downloaded free from mapeditor.org. Tiled allows you to define your own tilesets and export the data in various formats, including JSON, which can be easily read into Python.

Get your copy of Wireframe issue 15

You can read more features like this one in Wireframe issue 15, available now at Tesco, WHSmith, and all good independent UK newsagents.

Or you can buy Wireframe directly from Raspberry Pi Press — delivery is available worldwide. And if you’d like a handy digital version of the magazine, you can also download issue 15 for free in PDF format.

Make sure to follow Wireframe on Twitter and Facebook for updates and exclusive offers and giveaways. Subscribe on the Wireframe website to save up to 49% compared to newsstand pricing!

The post Coding an isometric game map | Wireframe issue 15 appeared first on Raspberry Pi.



Source: Raspberry Pi – Coding an isometric game map | Wireframe issue 15

Quick Fix — a vending machine for likes and followers

Sometimes we come across a project that just scores a perfect 10 on all fronts. This is one of them: an art installation using Raspberry Pi that has something interesting to say, does it elegantly, and is implemented beautifully (nothing presses our buttons like a make that’s got a professionally glossy finish like this).

Quick Fix is a vending machine (and art installation) that sells social media likes and followers. Drop in a coin, enter your social media account name, and an army of fake accounts will like or follow you. I’ll leave the social commentary to you. Here’s a video from the maker, Dries Depoorter:

Quick Fix – the vending machine selling likes and followers

Quick Fix in an interactive installation by Dries Depoorter. The artwork makes it possible to buy followers or likes in just a few seconds. For a few euros you already have 200 of likes on Instagram. “Quick Fix “is easy to use. Choose your product, pay and fill in your social media username.

There’s a Raspberry Pi 3B+ in there, along with an Arduino, powering a coin acceptor and some I2C LCD screens. Then there’s a stainless steel heavy-duty keyboard, which we’re lusting after (a spot of Googling unearthed this, which appears to be the same thing, if you’re in the market for a panel-mounted beast of a keyboard).

This piece was commissioned by Pixelache, a cultural association from Helsinki, whose work looks absolutely fascinating if you’ve got a few minutes to browse. Thanks to them and to Dries Depoorter — I have a feeling this won’t be the last of his projects we’re going to feature here.

The post Quick Fix — a vending machine for likes and followers appeared first on Raspberry Pi.



Source: Raspberry Pi – Quick Fix — a vending machine for likes and followers

HeaterMeter, the open-source barbecue controller

We spent the weekend knee-deep in marinade. (Top tip: if you’re brining something big, like a particularly plump chicken, buy a cheap kitchen bin. The depth makes it much easier than juggling near-overflowing buckets. And when you’re finished, you have a spare bin.)

meat

If you’re a serious barbecue jockey, you’ll want to know about Bryan Mayland’s HeaterMeter, a rather nifty open-source controller for your barbecue, built around a Raspberry Pi. Controlling the heat of your setup is key in low, slow cooking and smoking; you can get glorious results very inexpensively (an off-the-shelf equivalent will set you back a few hundred pounds) and have the satisfaction of knowing you built your equipment yourself. Bryan says:

Temperature data read from a standard thermistor (ThermoWorks, Maverick) or thermocouple probe is used to adjust the speed of a blower fan motor mounted to the BBQ grill to maintain a specific set temperature point (setpoint). A servo-operated damper may optionally be employed. Additional thermistor probes are used to monitor food and/or ambient temperatures, and these are displayed on a 16×2 LCD attached to the unit. Buttons or serial commands can be used to adjust configuration of the device, including adjustment of the setpoint or manually regulating fan speeds.

The Raspberry Pi adds a web interface, with graphing, archives, and SMS/email support for alarm notification, which means you can go and splash around in the kids’ paddling pool with a beer rather than spending the day standing over the grill with a temperature probe.

Heatermeter graph output

You can buy a HeaterMeter online, in kit form or pre-assembled. There’s an incredibly comprehensive wiki available to get you going with the HeaterMeter, and a very straightforward Instructable if you’re just looking for a quick setup. If you’re the type who prefers to learn by watching, Bryan also has a few videos on YouTube where he puts the kit together. To start with, see how to assemble the LCD/button board here and the base board here.

We’re hungry.

The post HeaterMeter, the open-source barbecue controller appeared first on Raspberry Pi.



Source: Raspberry Pi – HeaterMeter, the open-source barbecue controller

Toilet Tracker: automated poo-spotting, no cameras

It might be that I am unusually particular here, but there is nothing (absolutely NOTHING) that upsets me more than dirty toilets. Yes, I know this is the epitome of a pampered-person’s phobia. But I have nightmares — honest, actual, recurring nightmares — about horrible toilets, and I’ll plan my day around avoiding public toilets which are likely to be dirty. So this project appealed to me enormously.

Obi-Wan and the Worst Toilet in Scotland

Automating spotting that things are awry in a toilet cubicle without breaching privacy is really tricky. You can’t use a camera, for obvious reasons. Over at Hackster.io, Mohammad Khairul Alam has come up with a solution: he uses a Raspberry Pi hooked up to Walabot, a 3D imaging sensor (the same sort of thing you might use to find pipes behind studwork if you’re doing DIY) to detect one thing: whether there are any…objects in the toilet cubicle which weren’t there earlier.

From a privacy point of view, this is perfect. The sensor isn’t a camera, and it doesn’t know exactly what it’s looking at: just that there’s a thing where there shouldn’t be.

The Walabot is programmed to understand when the toilet is occupied by sensing above seat level; it’s also looking closer to the floor when the cubicle is empty, for seat-smudges, full bowls, and nasty stuff on the floor. (Writing this post is making me all shuddery. Like I said, I really, really have a problem with this.) Here’s a nice back-of-an-envelope explanation of the logic:

There’s a simple Android app to accompany the setup so you can roll out your own if you have an office with an upsetting toilet.

Learn (much) more over at Hackster — thanks to Md. Khairul Alam for the build!

The post Toilet Tracker: automated poo-spotting, no cameras appeared first on Raspberry Pi.



Source: Raspberry Pi – Toilet Tracker: automated poo-spotting, no cameras

Yuri 3 rover | The MagPi #82

In honour of the 50th anniversary of the Apollo moon landing, this year’s Pi Wars was space-themed. Visitors to the two-day event — held at the University of Cambridge in March — were lucky enough to witness a number of competitors and demonstration space-themed robots in action.

Yuri 3 rover

Among the most impressive was the Yuri 3 mini Mars rover, which was designed, lovingly crafted, and operated by Airbus engineer John Chinner. Fascinated by Yuri 3’s accuracy, we got John to give us the inside scoop.

Airbus ambassador

John is on the STEM Ambassador team at Airbus and has previously demonstrated its prototype ExoMars rover, Bridget (you can drool over images of this here: magpi.cc/btQnEw), including at the BBC Stargazing Live event in Leicester. Realising the impressive robot’s practical limitations in terms of taking it out and about to schools, John embarked on a smaller but highly faithful, easily transportable Mars rover. His robot-building experience began in his teens with a six-legged robot he took along to his technical engineering apprenticeship interview and had walk along the desk. Job deftly bagged, he’s been building robots ever since.

Inside the Yuri 3 Mars rover

Yuri is a combination of an Actobotics chassis based on one created by Beatty Robotics plus 3D-printed wheels and six 12 V DC brushed gears. Six Hitec servo motors operate the steering, while the entire rover has an original Raspberry Pi B+ at its heart.

Yuri 3 usually runs in ‘tank steer’ mode. Cannily, the positioning of four of its six wheels at the corners means Yuri 3’s wheels can each be turned so that it spins on the spot. It can also ‘crab’ to the side due to its individually steerable wheels.

Servo motors

The part more challenging for home users is the ‘gold thermal blanket’. The blanket ensures that the rover can maintain working temperature in the extreme conditions found on Mars. “I was very fortunate to have a bespoke blanket made by the team who make them for satellites,” says John. “They used it as a training exercise for the apprentices.”

John has made some bookmarks from the leftover thermal material which he gives away to schools to use as prizes.

Yuri 3 rover thermal blanket samples

Rover design

While designing Yuri 3, it probably helped that John was able to sneak peeks of Airbus’s ExoMars prototypes being tested at the firm’s Mars Yard. (He once snuck Yuri 3 onto the yard and gave it a test run, but that’s supposed to be a secret!) Also, says John, “I get to see the actual flight rover in its interplanetary bio clean room”.

A young girl inspects the Yuri 3 Mars rover

His involvement with all things Raspberry Pi came about when he was part of the Astro Pi programme, in which students send code to two Raspberry Pi devices aboard the International Space Station every year. “I did the shock, vibration, and EMC testing on the actual Astro Pi units in Airbus, Portsmouth,” John proudly tells us.

A very British rover

As part of the European Space Agency mission ExoMars, Airbus is building and integrating the rover in Stevenage. “What a fantastic opportunity for exciting outreach,” says John. “After all the fun with Tim Peake’s Principia mission, why not make the next British astronaut a Mars rover? … It is exciting to be able to go and visit Stevenage and see the prototype rovers testing on the Mars Yard.”

The Yuri 3 Mars rover

John also mentions that he’d love to see Yuri 3 put in an appearance at the Raspberry Pi Store; in the meantime, drooling punters will have to build their own Mars rover from similar kit. Or, we’ll just enjoy John’s footage of Yuri 3 in action and perhaps ask very nicely if he’ll bring Yuri along for a demonstration at an event or school near us.

John wrote about the first year of his experience building Yuri 3 on his blog. And you can follow the adventures of Yuri 3 over on Twitter: @Yuri_3_Rover.

Read the new issue of The MagPi

This article is from today’s brand-new issue of The MagPi, the official Raspberry Pi magazine. Buy it from all good newsagents, subscribe to pay less per issue and support our work, or download the free PDF to give it a try first.

Cover of The MagPi issue 82

The post Yuri 3 rover | The MagPi #82 appeared first on Raspberry Pi.



Source: Raspberry Pi – Yuri 3 rover | The MagPi #82

Penguin Watch — Pi Zeros and Camera Modules in the Antarctic

Long-time readers will remember Penguin Lifelines, one of our very favourite projects from back in the mists of time (which is to say 2014 — we have short memories around here).

Penguins

Click on penguins for fun and conservation

Penguin Lifelines was a programme run by the Zoological Society of London, crowdsourcing the tracking of penguin colonies in Antarctica. It’s since evolved into something called Penguin Watch, now working with the World Wildlife Fund (WWF) and British Antarctic Survey (BAS). It’s citizen science on a big scale: thousands of people from all over the world come together on the internet to…click on penguins. By counting the birds in their colonies, users help penguinologists measure changes in the birds’ behaviour and habitat, and in the larger ecosystem, thus assisting in their conservation.

The penguin people say this about Penguin Watch:

Some of these colonies are so difficult to get to that they haven’t been visited for 50 years! The images contain unprecedented detail, giving us the opportunity to gather new data on the number of penguins in the region. This information will help us understand how they are being affected by climate change, the potential impact of local fisheries, and how we can help conserve these incredible species.

Pis in the coldest, wildest place

And what are those special cameras? The static ones providing time-lapse images are Raspberry Pi Camera Modules, mounted on Raspberry Pi Zeros, and we’re really proud to see just how robust they’ve been in the face of Antarctic winters.

Alasdair Davies on Twitter

Success! The @arribada_i timelapse @Raspberry_Pi Zero cameras built for @penguin_watch survived the Antarctic winter! They captured these fantastic photos of a Gentoo penguin rookery for https://t.co/MEzxbqSyc1 #WorldPenguinDay 🐧@helenlynn @philipcolligan https://t.co/M0TK5NLT6G

These things are incredibly tough. They’re the same cameras that Alasdair and colleagues have been sticking on turtles, at depths of down to 500m; I can’t think of a better set of tests for robustness.

Want to get involved? Head over to Penguin Watch, and get clicking! We warn you, though — it’s a little addictive.

The post Penguin Watch — Pi Zeros and Camera Modules in the Antarctic appeared first on Raspberry Pi.



Source: Raspberry Pi – Penguin Watch — Pi Zeros and Camera Modules in the Antarctic

Motion-controlled water fountain…for cats!

Tired of the constant trickle of your cat’s water fountain? Set up motion detection and put your cat in control.


Cats are fickle

My cat, Jimmy, loves drinking from running water. Or from the sink. Or from whatever glass I am currently using. Basically, my cat loves drinking out of anything that isn’t his water bowl…because like all cats, he’s fickle and lives to cause his humans as much aggravation as possible.

Here’s a photo of my gorgeous boy, because what cat owner doesn’t like showing off their cat at the slightest opportunity?

Jimmy’s getting better now, thanks to the introduction of a pet water fountain in the kitchen, and we’ve somehow tricked him into using it — but what I don’t like is how the constant trickle of water makes me want to pee all the time.

Thankfully, this motion-controlled water foundation from Hackster.io maker vladimirm is here to save the day by only turning on the fountain when his cat approached it.

Motion-controlled pet water foundation

So how does it work? Vladimir explains:

When the PIR sensor detects movement, it sends a message to the radio dongle plugged to the Raspberry Pi, which sends the message to the MQTT server. On the other side, the MQTT message is processed by the Home Assistant, which then, using the automation, triggers the smart plug and starts the configured countdown.

The build uses an old Raspberry Pi 1 Model B, and a BigClown Motion Detector Kit, alongside a TP-Link smart plug and an open-source Home Assistant. The Home Assistant smartphone app documents when the smart plug is activated, and for how long, which also means you can track when your pet is drinking and check they’re getting enough water.

Vladimir goes into far more detail in the project tutorial. Now go help your cat stay hydrated!

The post Motion-controlled water fountain…for cats! appeared first on Raspberry Pi.



Source: Raspberry Pi – Motion-controlled water fountain…for cats!

We’re on holiday!

It’s a bank holiday here in the UK, so we’re taking the day off to spend some time with our families. If you’re desperate to read some content, I’ve got good news for you: there are thousands of posts about the Raspberry Pi that you can leaf through right here. Head over to the archive and fill your boots!

Normal service will resume tomorrow. In the meantime, here’s Hypnotoad so you can have something to look at.

The post We’re on holiday! appeared first on Raspberry Pi.



Source: Raspberry Pi – We’re on holiday!

Liverpool MakeFest | HackSpace magazine #19

The news that UK Maker Faire was to shut its doors came as a bit of a surprise to many. This vibrant weekend of makers meeting, sharing, and learning was absolutely brilliant, and left us fizzing with ideas after our visits there. We’re sad that it’s gone.

Makers being makers though, if there’s demand, it will be filled. And that’s exactly what’s happening in Liverpool with Liverpool MakeFest. On 29 June 2019, the MakeFest will hold its fifth iteration. This is the UK’s biggest free maker event, attracting thousands of visitors, and its vision of a free, maker-focused festival is spreading far and wide.

We visited the mid-Victorian splendour of Liverpool Central Library, the home of MakeFest, to talk to the founders — Denise Jones, Mark Feltham, and Caroline Keep — to find out what makes this event special.

Liverpool MakeFest 2019 is taking place at the Central Library, Saturday 29 June 2019, and it’s completely free to attend

HackSpace magazine: Hello! Thanks for having us over here. How did the three of you come together to start Liverpool MakeFest?

Caroline Keep: I was a geotechnical engineer, Mark’s an academic, and Denise is a librarian. We bumped into each other watching a workshop in lantern making. Mark had all the academic experience. When I came to work with Mark on his makerspace, I was the geeky maker — he didn’t even have a smartphone at that time. I got the education bug and then moved into secondary school teaching.

Mark Feltham: It all started over there, as a chance meeting. We bumped into each other and got chatting. Within six weeks, we’d filled the library. We thought it would be a one-off, but since then it’s taken off.

Caroline is the reigning TES New Teacher Of The Year

HS: So no business plan, no franchising fees, no world domination?

CK: We’ve just winged it. We made all the banners, bunting. The first year my PGCE fund paid for MakeFest! This building reopened again in 2013, and in 2014 we were lucky that they were running a programme of events and initiatives to make it a really vibrant building, so it was the right time as well. We thought we’d have a little room off to the side and get maybe six tables. We’d already done a Mini Maker Faire, and we’ve always been good friends with [local makerspace] DoES Liverpool, so we were confident we’d get at least a few people turning up. And in six weeks we were full.

MF: We pulled the first one off, we’re talking the first three floors of the library and 60 makers, for £850. And that included feeding them and making badges as well.

One of the spin-offs that have come out of MakeFest is Little Sandboxes, which takes making out to deprived areas of the city

HS: For context, this building is huge. It’s bigger than most libraries; it’s probably about the same size as the Life Centre in Newcastle, where UK Maker Faire was held until recently. It must have helped to have a librarian on board to negotiate with the powers that be?

Denise Jones: I had to sell it to the people in charge back then, which were the head of service and the manager of this building. The Department for Culture, Media and Sport has a Taskforce for Libraries, which is funded until next year. We’re close to finishing the national guidance now for the Taskforce — the idea is to get one of these [MakeFests] in every library. We wanted the guidance doc to be inclusive of museums and libraries, because we knew that Manchester had opted to put their MakeFest in a museum. We’ve got Chester and Stoke MakeFest, and there’s one in the pipeline in Wrexham. We were having the same conversations over and over again, so we decided to write a document: how to run a MakeFest.

Liverpool Central Library was renovated a few years ago — the precious books went into temporary storage in a salt mine in Cheshire to keep them dry

HS: What have we got to look forward to this year and beyond?

CK: That’s a good question. We’ve got some corking stuff coming this year. We’ve given it the theme ’Space and time – creativity in the making’. We’ve got events planned for the Apollo anniversary, and [just] before MakeFest we’re going to kick off with a music day, showing people how to make music, and making the instruments to make music. That’s another spin-off that’s come out of MakeFest: the MakerNoise Unconference at Edge Hill University.

MF: We’ve always felt that we hold MakeFest in trust for makers. In terms of where it goes long-term, I don’t see it ever becoming more than a one-day event here, because one day is good. It gives people Sunday to get over things, and get home because they have day jobs on a Monday. We’re always very sensitive to that, we don’t want to take up too much of people’s time. The other thing is that I don’t see it spilling out into a bigger building; it’s always going to be in the library. But the way to grow it is to put it in other libraries. Not to make this one, Liverpool, bigger and take over. Then each maker community gets its own feel, and its own vibe — Stoke MakeFest has a very different feel to ours, because their maker scene is different to ours, and their city is different to ours.

The other way to expand it is that, rather than by just expanding to other cities, you can have more events on throughout the year. Rather than being solely a one-day event, you can have all these spin-offs, so once a month there’s something going on. Rather than it just being about tech and digital, we’ve always liked to have some sort of fantasy element. Things like Doctor Who, Star Wars, Darth Vader, K-9 — the kids love that. We have a lot of friends who are into steampunk; they get roped in to do front-of-house duties. You know what the funny thing was at the first one? Not only did the public enjoy it, but also the makers. It’s kind of like a musician playing an acoustic set. We’ve got a get-together on the Thursday before, we’ve got a Friday night party going, we always do an after-party. The public come on the Saturday, but there’s always stuff going on that week for makers.

In addition to always wanting it to be free for the public, and for the makers to not have to pay for their stand, we feel very strongly that we should give something back. We always give them lunch, we always give them a badge, and there’s always a party. We can’t pay them, but it’s our way of showing our appreciation to the makers who come and make it what it is. The celebration and sharing are big parts of the maker ethos.

People like to show [their projects] not to show off, not to say ‘Look at how clever I am’ — it’s more to say ‘Look at this awesome thing, isn’t this cool?’ Trying to explain that to people can be tricky. You can make this: here’s how you do it. That’s the ethos.

CK: I always feel with MakeFest — you said it’s like an acoustic gig. I always envisioned it as Liverpool’s party for makers. It’s our little get-together, and that’s how I like it.

Read the full interview in HackSpace magazine issue 19, out now! This month we’re looking at building a walking robot, laser cutting LED jewellery, the 55 timer chip, and much more. Download the issue for free, or buy it in print on our website.

Get HackSpace magazine issue 19 from all good newsagents

Special subscription offer

To have 132 pages of making delivered to your doorstep every month, subscribe to HackSpace magazine from just £5 for your first three issues.

The post Liverpool MakeFest | HackSpace magazine #19 appeared first on Raspberry Pi.



Source: Raspberry Pi – Liverpool MakeFest | HackSpace magazine #19

Make a Donkey Kong–style walk cycle | Wireframe issue 14

Effective animation gave Donkey Kong barrels of personality. Raspberry Pi’s own Rik Cross explains how to create a similar walk cycle.

Donkey Kong wasn’t the first game to feature an animated character who could walk and jump, but on its release in 1981, it certainly had more personality than the games that came before it. You only have to compare Donkey Kong to another Nintendo arcade game that came out just two years earlier — the half-forgotten top-down shooter Sheriff — to see how quickly both technology and pixel art moved on in that brief period. Although simple by modern standards, Donkey Kong’s hero Jumpman (later known as Mario) packed movement and personality into just a few frames of animation.

In this article, I’ll show you how to use Python and Pygame to create a character with a simple walk cycle animation like Jumpman’s in Donkey Kong. The code can, however, be adapted for any game object that requires animation, and even for multiple game object animations, as I’ll explain later.

Jumpman’s (aka Mario’s) walk cycle comprised just three frames of animation.

Firstly, we’ll need some images to animate. As this article is focused on the animation code and not the theory behind creating walk cycle images, I grabbed some suitable images created by Kenney Vleugels and available at opengameart.org.

Let’s start by animating the player with a simple walk cycle. The two images to be used in the animation are stored in an images list, and an animationindex variable keeps track of the index of the current image in the list to display. So, for a very simple animation with just two different frames, the images list will contain two different images:

images = [‘walkleft1’,‘walkleft2’

To achieve a looping animation, the animationindex is repeatedly incremented, and is reset to 0 once the end of the images list is reached. Displaying the current image can then be achieved by using the animationindex to reference and draw the appropriate image in the animation cycle:

self.image = self.images[self.state][self.animationindex]

A list of images along with an index is used to loop through an animation cycle.

The problem with the code described so far is that the animationindex is incremented once per frame, and so the walk cycle will happen way too quickly, and won’t look natural. To solve this problem, we need to tell the player to update its animation every few frames, rather than every frame. To achieve this, we need another couple of variables; I’ll use animationdelay to store the number of frames to skip between displayed images, and animationtimer to store the number of frames since the last image change.

Therefore, the code needed to animate the player becomes:

self.animationtimer += 1<br/>
if self.animationtimer &gt;= self.animationdelay:<br/>
self.animationtimer = 0<br/>
self.animationindex += 1<br/>
if self.animationindex &gt; len(self.images) - 1:<br/>
self.animationindex = 0<br/>
self.image = self.images[self.animationindex]

So we have a player that appears to be walking, but now the problem is that the player walks constantly, and always in the same direction! The rest of this article will show you how to solve these two related problems.

There are a few different ways to approach this problem, but the method I’ll use is to make use of game object states, and then have different animations for each state. This method is a little more complicated, but it’s very adaptable.

The first thing to do is to decide on what the player’s ‘states’ might be — stand, walkleft, and walkright will do as a start. Just as we did with our previous single animation, we can now define a list of images for each of the possible player’s states. Again, there are lots of ways of structuring this data, but I’ve opted for a Python dictionary linking states and image lists:

self.images = { ‘stand’ : [‘stand1’],<br/>
‘walkleft’ : [‘walkleft1’,‘walkleft2’],<br/>
‘walkright’ : [‘walkright1’,‘walkright2’]<br/>
}

The player’s state can then be stored, and the correct image obtained by using the value of state along with the animationindex:

self.image = self.images[self.state][self.animationindex]

The correct player state can then be set by getting the keyboard input, setting the player to walkleft if the left arrow key is pressed or walkright if the right arrow key is pressed. If neither key is pressed, the player can be set to a stand state; the image list for which contains a single image of the player facing the camera.

Animation cycles can be linked to player ‘states’.

For simplicity, a maximum of two images are used for each animation cycle; adding more images would create a smoother or more realistic animation.

Using the code above, it would also be possible to easily add additional states for, say, jumping or fighting enemies. You could even take things further by defining an Animation() object for each player state. This way, you could specify the speed and other properties (such as whether or not to loop) for each animation separately, giving you greater flexibility.

Here’s Rik’s animated walk cycle, coded in Python. To get it running on your system, you’ll first need to install Pygame Zero. And to download the full code, go here.

Get your copy of Wireframe issue 14

You can read more features like this one in Wireframe issue 14, available now at Tesco, WHSmith, and all good independent UK newsagents.

Or you can buy Wireframe directly from Raspberry Pi Press — delivery is available worldwide. And if you’d like a handy digital version of the magazine, you can also download issue 14 for free in PDF format.

Make sure to follow Wireframe on Twitter and Facebook for updates and exclusive offers and giveaways. Subscribe on the Wireframe website to save up to 49% compared to newsstand pricing!

The post Make a Donkey Kong–style walk cycle | Wireframe issue 14 appeared first on Raspberry Pi.



Source: Raspberry Pi – Make a Donkey Kong–style walk cycle | Wireframe issue 14

His Royal Highness the Duke of York visits Raspberry Pi HQ

We welcomed a very special guest to Raspberry Pi HQ today.

Our Patron, His Royal Highness Prince Andrew, the Duke of York, visited our central Cambridge HQ to meet our team, learn more about our work, and give his support for our mission to help more young people learn how to create with computers.

Prince Andrew speaking at a lectern

Royalty and Raspberry Pi

Avid readers of this blog will know that this isn’t Raspberry Pi’s first royal encounter. Back in 2014, Raspberry Pi was one of the UK tech startups invited to showcase our product at a reception at Buckingham Palace. At that stage, we had just celebrated the sale of our two millionth credit card–sized computer.

Fast forward to October 2016, when were celebrating the sale of our ten millionth Raspberry Pi computer with a reception at St James Palace and 150 members of our community. By this time, not only was our product flying off the shelves, but the Foundation had merged with Code Club, had expanded its teacher training programmes, and was working with thousands of volunteers to bring computing and digital making to tens of thousands of young people all over the world.

Prince Andrew and a woman watching a computer screen

Both of our trips to the royal palaces were hosted by Prince Andrew, who has long been a passionate advocate for technology businesses and digital skills. On top of his incredible advocacy work, he’s also an entrepreneur and innovator in his own right, founding and funding initiatives such as iDEA and Pitch at the Palace, which make a huge impact on digital skills and technology startups.

We are really very fortunate to have him as our Patron.

Leaps and bounds

Today’s visit was an opportunity to update Prince Andrew on the incredible progress we’ve made towards our mission since that first trip to Buckingham Palace.

We now have over 25 million Raspberry Pi computers in the wild, and people use them in education, in industry, and for their hobbies in an astonishing number of ways. Through our networks of Code Clubs and CoderDojos, we have supported more than a million young people to learn how to create with technology while also developing essential life skills such as teamwork, resilience, and creativity. You can read more about what we’ve achieved in our latest Annual Review.

Prince Andrew speaking to two seated people

We talked with Prince Andrew about our work to support computing in the classroom, including the National Centre for Computing Education in England, and our free online teacher training that is being used by tens of thousands of educators all over the world to develop their skills and confidence.

Prince Andrew shares our determination to encourage more girls to learn about computing and digital making, and we discussed our #realrolemodels campaign to get even more girls involved in Code Clubs and CoderDojos, as well as the groundbreaking gender research project that we’ve launched with support from the UK government.

Dream team

One of our rituals at the Raspberry Pi Foundation is the monthly all-staff meetup. On the third Wednesday of every month, colleagues from all over the world congregate in Cambridge to share news and updates, learn from each other, and plan together (and yes, we have a bit of fun too).

Prince Andrew and three other men watching a computer screen

My favourite part of Prince Andrew’s visit is that he organised it to coincide with the all-staff meetup. He spent most of his time speaking to team members and hearing about the work they do every day to bring our mission to life through creating educational resources, supporting our massive community of volunteers, training teachers, building partnerships, and much more.

In his address to the team, he said:

Raspberry Pi is one of those organisations that I have been absolutely enthralled by because of what you have enabled. The fact that there is this piece of hardware that started this, and that has led to educational work that reaches young people everywhere, is just wonderful.

In the 21st century, every single person in the workplace is going to have to use and interact with some form of digital technology. The fact that you are giving the next generation the opportunity to get hands-on is fantastic.

The post His Royal Highness the Duke of York visits Raspberry Pi HQ appeared first on Raspberry Pi.



Source: Raspberry Pi – His Royal Highness the Duke of York visits Raspberry Pi HQ