FluSense takes on COVID-19 with Raspberry Pi

Raspberry Pi devices are often used by scientists, especially in biology to capture and analyse data, and a particularly striking – and sobering – project has made the news this week. Researchers at UMass Amherst have created FluSense, a dictionary-sized piece of equipment comprising a cheap microphone array, a thermal sensor, an Intel Movidius 2 neural computing engine, and a Raspberry Pi. FluSense monitors crowd sounds to forecast outbreaks of viral respiratory disease like seasonal flu; naturally, the headlines about their work have focused on its potential relevance to the COVID-19 pandemic.

A photo of Forsad Al Hossain and Tauhidur Rahman with the FluSense device alongside a logo from the Amherst University of Massachusetts

Forsad Al Hossain and Tauhidur Rahman with the FluSense device. Image courtesy of the University of Massachusetts Amherst

The device can distinguish coughing from other sounds. When cough data is combined with information about the size of the crowd in a location, it can provide an index predicting how many people are likely to be experiencing flu symptoms.

It was successfully tested in in four health clinic waiting rooms, and now, PhD student Forsad Al Hossain and his adviser, assistant professor Tauhidur Rahman, plan to roll FluSense out in other large spaces to capture data on a larger scale and strengthen the device’s capabilities. Privacy concerns are mitigated by heavy encryption, and Al Hossain and Rahman explain that the emphasis is on aggregating data, not identifying sickness in any single patient.

The researchers believe the secret to FluSense’s success lies in how much of the processing work is done locally, via the neural computing engine and Raspberry Pi: “Symptom information is sent wirelessly to the lab for collation, of course, but the heavy lifting is accomplished at the edge.”

A bird's-eye view of the components inside the Flu Sense device

Image courtesy of the University of Massachusetts Amherst

FluSense offers a different set of advantages to other tools, such as the extremely popular self-reporting app developed by researchers at Kings College Hospital in London, UK, together with startup Zoe. Approaches like this rely on the public to sign up, and that’s likely to skew the data they gather, because people in some demographic groups are more likely than others to be motivated and able to participate. FluSense can be installed to capture data passively from groups across the entire population. This could be particularly helpful to underprivileged groups who are less likely to have access to healthcare.

Makers, engineers, and scientists across the world are rising to the challenge of tackling COVID-19. One notable initiative is the Montreal General Hospital Foundation’s challenge to quickly design a low-cost, easy to use ventilator which can be built locally to serve patients, with a prize of CAD $200,000 on offer. The winning designs will be made available to download for free.

There is, of course, loads of chatter on the Raspberry Pi forum about the role computing has in beating the virus. We particularly liked this PSA letting you know how to free up some of your unused processing power for those researching treatments.

screenshot of the hand washer being built from a video on instagram

Screenshot via @deeplocal on Instagram

And to end on a cheering note, we *heart* this project from @deeplocal on Instagram. They’ve created a Raspberry Pi-powered soap dispenser which will play 20 seconds of your favourite song to keep you at the sink and make sure you’re washing your hands for long enough to properly protect yourself.

The post FluSense takes on COVID-19 with Raspberry Pi appeared first on Raspberry Pi.

Noticia Original

Using Raspberry Pi for deeper learning in education

Using deeper learning as a framework for transformative educational experiences, Brent Richardson outlines the case for a pedagogical approach that challenges students using a Raspberry Pi. From the latest issue of Hello World magazine — out today!

A benefit of completing school and entering the workforce is being able to kiss standardised tests goodbye. That is, if you don’t count those occasional ‘prove you watched the webinar’ quizzes some supervisors require.

In the real world, assessments often happen on the fly and are based on each employee’s ability to successfully complete tasks and solve problems. It is often obvious to an employer when their staff members are unprepared.

Formal education continues to focus on accountability tools that measure base-level proficiencies instead of more complex skills like problem-solving and communication.

One of the main reasons the U.S. education system is criticised for its reliance on standardised tests is that this method of assessing a student’s comprehension of a subject can hinder their ability to transfer knowledge from an existing situation to a new situation. The effect leaves students ill-prepared for higher education and the workforce.

A study conducted by the National Association of Colleges and Employers found a significant gap between how students felt about their abilities and their employer’s observations. In seven out of eight categories, students rated their skills much higher than their prospective employers had.

Some people believe that this gap continues to widen because teaching within the confines of a standardised test encourages teachers to narrow their instruction. The focus becomes preparing students with a limited scope of learning that is beneficial for testing.

With this approach to learning, it is possible that students can excel at test-taking and still struggle with applying knowledge in new ways. Educators need to have the support to not only prepare students for tests but also to develop ways that will help their students connect to the material in a meaningful manner.

In an effort to boost the U.S. education system’s ability to increase the knowledge and skills of students, many private corporations and nonprofits directly support public education. In 2010, the Hewlett Foundation went so far as to develop a framework called ‘deeper learning’ to help guide its education partners in preparing learners for success.

The principles of deeper learning

Deeper learning focuses on six key competencies:

    1. Master core academic content
    2. Think critically and solve
      complex problems
    3. Work collaboratively
    4. Communicate effectively
    5. Learn how to learn
    6. Develop academic mindsets

This framework ensures that learners are active participants in their education. Students are immersed in a challenging curriculum that requires them to seek out and acquire new information, apply what they have learned, and build upon that to create new knowledge.

While deeper learning experiences are important for all students, research shows that schools that engage students from low-income families and students of colour in deeper learning have stronger academic outcomes, better attendance and behaviour, and lower dropout rates. This results in higher graduation rates, and higher rates
of college attendance and perseverance than comparison schools serving similar students. This pedagogical approach is one we strive to embed in all our work at Fab Lab Houston.

A deeper learning timelapse project

The importance of deeper learning was undeniable when a group of students I worked with in Houston built a solar-powered time-lapse camera. Through this collaborative project, we quickly found ourselves moving beyond classroom pedagogy to a ‘hero’s journey’ — where students’ learning paths echo a centuries-old narrative arc in which a protagonist goes on an adventure, makes new friends, encounters roadblocks, overcomes adversity, and returns home a changed person.

In this spirit, we challenged the students with a simple objective: ‘Make a device to document the construction of Fab Lab Houston’. In just one sentence, participants understood enough to know where the finish line was without being told exactly how to get there. This shift in approach pushed students to ask questions as they attempted to understand constraints and potential approaches.

Students shared ideas ranging from drone video to photography robots. Together everyone began to break down these big ideas into smaller parts and better define the project we would tackle together. To my surprise, even the students that typically refused to do most things were excited to poke holes in unrealistic ideas. It was decided, among other things, that drones would be too expensive, robots might not be waterproof, and time was always a concern.

The decision was made to move forward with the stationary time-lapse camera, because although the students didn’t know how to accomplish all the aspects of the project, they could at least understand the project enough to break it down into doable parts and develop a ballpark budget. Students formed three teams and picked one aspect of the project to tackle. The three subgroups focused on taking photos and converting them to video, developing a remote power solution, and building weatherproof housing.

A group of students found sample code for Raspberry Pi that could be repurposed to take photos and store them sequentially on a USB drive. After quick success, a few ambitious learners started working to automate the image post-processing into video. Eventually, after attempting multiple ways to program the computer to dynamically turn images into video, one team member discovered a new approach: since the photos were stored with a sequential numbering system, thousands of photos could be loaded into Adobe Premiere Pro straight off the USB with the ‘Automate to Sequence’ tool in Premiere.

A great deal of time was spent measuring power consumption and calculating solar panel and battery size. Since the project would be placed on a pole in the middle of a construction site for six months, the students were challenged with making their solar-powered time-lapse camera as efficient as possible.

Waking the device after it was put into sleep mode proved to be more difficult than anticipated, so a hardware solution was tested. The Raspberry Pi computer was programmed to boot up when receiving power, take a picture, and then shut itself down. With the Raspberry Pi safely shut down, a timer relay cut power for ten minutes before returning power and starting the cycle again.

Finally, a waterproof container had to be built to house the electronics and battery. To avoid overcomplicating the process, the group sourced a plastic weatherproof ammunition storage box to modify. Students operated a 3D printer to create custom parts for the box.

After cutting a hole for the camera, a small piece of glass was attached to a 3D-printed hood, ensuring no water entered the box. On the rear of the box, they printed a part to hold and seal the cable from the solar panel where it entered the box. It only took a few sessions before the group produced a functioning prototype. The project was then placed outside for a day to test the capability of the device.

The test appeared successful when the students checked the USB drive. The drive was full of high-quality images captured every ten minutes. When the drive was connected back to Raspberry Pi, a student noticed that all the parts inside the case moved. The high temperature on the day of the test had melted the glue used to attach everything. This unexpected problem challenged students to research a better alternative and reattach the pieces.

Once the students felt confident in their device’s functionality, it was handed over to the construction crew, who installed the camera on a twenty-foot pole. The installation went smoothly and the students anxiously waited to see the results.

Less than a week after the camera went up, Houston was hit hard with the rains brought on by hurricane Harvey. The group was nervous to see whether the project they had constructed would survive. However, when they saw that their camera had survived and was working, they felt a great sense of pride.

They recognised that it was the collaborative effort of the group to problem-solve possible challenges that allowed their camera to not only survive but to capture a spectacular series of photos showing the impact of the hurricane in the location it was placed.

BakerRipleyTimeLapse2

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

A worthwhile risk

Overcoming many hiccups throughout the project was a great illustration of how the students learned how to learn and
to develop an academic mindset; a setback that at the beginning of the project might have seemed insurmountable was laughable in the end.

Throughout my experience as a classroom teacher, a museum educator, and now a director of a digital makerspace, I’ve seen countless students struggle to understand the relevance of learning, and this has led me to develop a strong desire to expand the use of deeper learning.

Sometimes it feels like a risk to facilitate learning rather than impart knowledge, but seeing a student’s development into a changed person, ready to help someone else learn, makes it worth the effort. Let’s challenge ourselves as educators to help students acquire knowledge and use it.

Get your FREE copy of Hello World today

Issue 12 of Hello World is available now as a FREE PDF download. UK-based educators can also subscribe to receive Hello World directly to their door in all its shiny printed goodness. Visit the Hello World website for more information.

The post Using Raspberry Pi for deeper learning in education appeared first on Raspberry Pi.

Noticia Original

Ashley’s top five projects for Raspberry Pi first-timers

It is time. Time to go to that little stack of gifts from well-wishers who have badged you as “techie” or noted that you “play computer games”. Armed with this information, they decided you’d like to receive one of our small and perfectly formed Raspberry Pis. You were thrilled. You could actually make a thing.

Except you haven’t. You had to go to that job thingy, and talk to that partner thingy, and wash and feed those children thingies. Don’t worry, we’re not offended. We know that embarking on your first coding project is daunting and that the community has taken off like a rocket so there are eight bajillion ideas floating around. Good job we’re here to help, then, isn’t?

First-timer project 01

Some of us have found ourselves spending more time with our online communities recently. Those whose digital family of choice is to be found on Reddit should see an uptick in their personal ‘Karma’ if they’re spending more time digging into “the front page of the internet”. If you’d like to see a real-world indicator of the fruits of your commenting/sharing/Let-Me-Google-That-For-You labour, a super-easy Raspberry Pi first-timer project is building a Karma counter, like this one we found on Reddit.

Now, Squiddles1227 is one of those flash 3D printer-owning types, but you could copy the premise and build your own crafty Karma-themed housing around your counter.

On a similar note (and featuring a comprehensive ‘How To’), GiovanniBauer on instructables.com used his Raspberry Pi to create an Instagram follower counter. Developed on Raspbian with Node.js, this project walk-through should get you started on whichever social media counter project you’d like to have a bash at.

First-timer project 02

We know this is a real-life Raspberry Pi first-timer project because the Reddit post title says so. Ninjalionman1 made an e-ink calendar using a Raspberry Pi Zero so they can see their daily appointments, weather report, and useful updates.

We mined the original Reddit thread to find you the comment linking to all the info you need about hardware and setup. Like I said, good job we’re here.

First-timer project 03

Raspberry Pi 3 and 4, as well as Raspberry Pi Zero W, come with built-in Bluetooth connectivity. This means you can build something to let your lockdown-weary self take your emotional-health-preserving music/podcasts/traditional chant soundtrack with you as you migrate around your living space. “Mornings in the lounge… mid-afternoons at the kitchen table…” – we feel you.

Circuitdigest.com posted this comprehensive walk-through to show you how a Raspberry Pi can convert an ordinary speaker with a 3.5mm jack into a wireless Bluetooth speaker.

First-timer project 04

PCWorld.com shared 10 Raspberry Pi projects they bet anyone can do, and we really like the look of this one. It shows you how to give a “dumb” TV extra smarts, like web browsing, which could be especially useful if screen availability is limited in a multi-user household.

The PCWorld article recommends using a Raspberry Pi 2, 3 or 4, and points out that this is a much cheaper option than things like Chromebits and Compute Sticks.

First-timer project 05

Lastly, electromaker.io have hidden the coding education vegetables in the Minecraft tomato sauce using Raspberry Pi. The third post down on this thread features a video explaining how you can hack your kids’ favourite game to get them learning to code.

The video blurb also helpfully points out that Minecraft comes pre-installed on Raspbian, making it “one of the greatest Pi projects for kids.”

If you’re not quite ready to jump in and try any of the above, try working your way through these really simple steps to set up your Raspberry Pi and see what it can do. Then come back here and try one of these first-timer projects, share the results of your efforts, tag us, and receive a virtual round of applause!

The post Ashley’s top five projects for Raspberry Pi first-timers appeared first on Raspberry Pi.

Noticia Original

Stay busy in your Vault with a Raspberry Pi Zero Pipboy

While being holed up in the Vaults living off our stash of Nuke cola, we’ve come across this mammoth junk-build project, which uses Raspberry Pi Zero W to power a working Pipboy.

Pipboy scrap build

No Description

UK-based JustBuilding went full Robert House and, over several months, built the device’s body by welding together scrap plastic. Raspberry Pi Zero W serves as the brain, with a display header mounted to the GPIO pins. The maker wrote a Pipboy-style user interface, including demo screens, in Python — et voilà…



Lucky for him, semiconductors were already invented but, as JustBuilding admits, this is not what we’d call a beginner’s project. Think the Blue Peter show’s Tracey Island extravaganza, except you don’t have crafty co-presenters/builders, and you also need to make the thing do something useful (for our US readers who just got lost there, think Mr Rogers with glitter glue and outdoor adventure challenges).

The original post on Instructables is especially dreamy, as JustBuilding has painstakingly produced a really detailed, step-by-step guide for you to follow, including in-the-making photos and links to relevant Raspberry Pi forum entries to help you out where you might get stuck along the way.

And while Raspberry Pi can help you create your own post-apocalyptic wristwear, we’re still working on making that Stealthboy personal cloaking device a reality…

If you’re lucky enough to have access to a 3D printer, the following is the kind of Pipboy you can knock up for yourself (though we really like JustBuilding’s arts’n’crafts upcycling style):

3D Printed Pipboy 3000 MKIV with Raspberry Pi

Find out how to 3D print and build your own functional Pipboy 3000 using a Raspberry Pi and Adafruit 3.5″ PiTFT. The pypboy python program for the Raspberry …

The post Stay busy in your Vault with a Raspberry Pi Zero Pipboy appeared first on Raspberry Pi.

Noticia Original

Don’t forget about Steam Link on Raspberry Pi

Connect your gaming PC to your TV with ease, thanks to Steam Link and Raspberry Pi.

A Steam Link to the past

Back in 2018, we asked Simon, our Asset Management Assistant Keeper of the Swag, Organiser of the Stuff, Lord Commander of the Things to give Steam Link on Raspberry Pi a try for us, as he likes that sort of thing and was probably going to do it anyway.

Valve’s Steam Link, in case you don’t know, allows users of the gaming distribution platform Steam to stream video games from their PC to a display of their choice via their home network, with no need for cumbersome wires and whatnot.

Originally produced as a stand-alone box in 2018, Valve released this tool as a free download to all Raspberry Pi users, making it accessible via a single line of code. Nice!

The result of Simon’s experiment was positive: he reported that setting up Steam Link was easy, and the final product was a simple and affordable means of playing PC games on his TV, away from his PC in another room.

And now…

Well, it’s 2020 and since many of us are staying home lately, so we figured it would be nice to remind you all that this streaming service is still available.

To set up Steam Link on your Raspberry Pi, simply enter the following into a terminal window:

sudo apt update
sudo apt install steamlink

The post Don’t forget about Steam Link on Raspberry Pi appeared first on Raspberry Pi.

Noticia Original

Activities you can do at home this week!

At the Raspberry Pi Foundation, our mission is to put the power of computing and digital making into the hands of people all over the world. We know that a lot of families around the globe are navigating school closures and practicing social distancing right now to keep their communities healthy and safe.

So in today’s post, we put together a list for you with some of our free online projects and resources that digital makers of all ages and experience levels can explore at home.

A family of digital makers (illustration)

For most of these projects, you don’t need any new software or hardware. And many of our online resources are available in multiple languages, so young learners can use them even if their mother language isn’t English!

Free activities for you at home

Beginner level:

  • Rock band: This activity is a great introduction to Scratch, a block-based coding language. You’ll learn how to get started with Scratch and start your dream music group. Rock on!
  • Pixel art: This is a great activity for anyone just getting started with programming. Grab some crayons or colored pencils and create your masterpiece!
  • Web page stickers: In this activity, you’ll learn the basics of HTML and create some stickers. We can’t wait to see what you make!

pixel art (illustration)

Intermediate level

  • Storytime with Python (the language not the snake!): Let your imagination run wild with this activity! You will use Python to create a program that generates a random story, based on what the user types in.
  • Meme generator: In this activity you will make a meme generator with HTML, CSS, and Javascript! Using an image of your choice (bonus points if the image is of your pet), you can create your own memes.

example of a meme

Advanced level

  • Getting started with GUIs: In this activity, you will create two simple GUIs (graphical user interfaces) in Python. This is where you can get fancy with buttons, menus, and even a text box!
  • Pride and Prejudice for zombies: Learn how to use Python web requests and regular expressions while creating a version of Pride and Prejudice that’s more appealing to zombies.

Not just for young learners

  • Build a web server with Flask: This is a great how-to project if you’d like to learn how to set up a web server and create a simple website using Flask, Python, and HTML/CSS. Be aware though, the guide may not always work smoothly, because of external updates.
  • Sign up for one of our free online courses. From programming to physical computing and running coding clubs, we’ve got something that will inspire you.
  • Check out The MagPi magazine! Download the free PDF of this month’s MagPi and read about the #MonthOfMaking, getting started with electronics, fancy ways to wear your Raspberry Pi, and more.

People creating a robot (illustration)

We are here to support you!

Our team is working hard to bring you more online learning experiences to support you, your children, and everyone in the community at this time. You can read our CEO Philip Colligan’s message about how we are responding to the novel coronavirus.

We want to make sure digital makers of all ages have the resources they need to explore and create with code. What do you think of these activities, and what else would you like to see? Tell us in the comments below!

The post Activities you can do at home this week! appeared first on Raspberry Pi.

Noticia Original

Build a physical game controller for Infinite Bunner

In HackSpace magazine issue 28 we had a look at how to create an ultrasonic controller for a version of Pong called Boing!. This month, we’re going to take a step further forward through video game history and look at the game Frogger. In this classic game, you control a frog as it makes its way across logs, roads, and train tracks, avoiding falling in the water or getting hit.

Infinite Bunner

The tribute to Frogger in the new Code the Classics Volume 1 book is called Infinite Bunner, and works in much the same way, except you control a bunny.

Jump along the logs, dodge the traffic, avoid the trains, and keep your bunny alive for as long as possible

All this hopping got us thinking about a controller. Our initial idea was that since the animals jump, so should the controller. An accelerometer can detect freefall, so it shouldn’t be too hard to convert that into button presses. However, it turns out that computer-controlled frogs and rabbits can jump much, much faster than humans can, and we really struggled to get a working game mechanic, so we compromised a little and worked with ‘flicks’.

The flick controller

The basic idea is that you tilt the controller left or right to move left or right, but you have to flick it up to register a jump (simply holding it upright won’t work).

We’ve used a Circuit Playground Bluefruit as our hardware, but it would work equally well with a Circuit Playground Express. There are two key parts to the software. The first is reading in accelerometer values and use these to know what orientation the board is in, and the second is the board mimicing a USB keyboard and sending keystrokes to any software running on it.

Playing Infinite Bunner

The first step is to get Infinite Bunner working on your machine.

Get your copy of Code the Classics today

You can download the code for all the Code the Classics Volume 1 games here. Click on Clone or Download > Download ZIP. Unzip the download somewhere.

You’ll need Python 3 with Pygame Zero installed. The process for this differs a little between different computers, but there’s a good overview of all the different options on page 186 of Code the Classics.

Subscribe to HackSpace magazine for twelve months and you get a Circuit Playground Express for free! Then you can make your very own Infinite Bunner controller

Once everything’s set up, open a terminal and navigate to the directory you unzipped the code in. Then, inside that, you should find a folder called bunner-master and move into that. You can then run:

python3 bunner.py

Have a few goes playing the game, and you’ll find that you need the left, right, and up arrow keys to play (there is also the down arrow, but we’ve ignored this since we’ve never actually used it in gameplay – if you’re a Frogger/Bunner aficionado, you may wish to implement this as well).

Reading the accelerometer is as easy as importing the appropriate module and running one line:

from adafruit_circuitplayground import cp
x, y, z = cp.acceleration

Sending key presses is similarly easy. You can set up a keyboard with the following:

from adafruit_hid.keyboard import Keyboard

from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS

from adafruit_hid.keycode import Keycode



keyboard = Keyboard(usb_hid.devices)

Then send key presses with code such as this:

time.keyboard.press(Keycode.LEFT_ARROW)
 time.sleep(0.1)

keyboard.release_all()

The only thing left is to slot in our mechanics. The X-axis on the accelerometer can determine if the controller is tilted left or right. The output is between 10 (all the way left) and -10 (all the way right). We chose to threshold it at 7 and -7 to require the user to tilt it most of the way. There’s a little bit of fuzz in the readings, especially as the user flicks the controller up, so having a high threshold helps avoid erroneous readings.

The Y-axis is for jumping. In this case, we require 
a ‘flap’ where the user first lifts it up (over a threshold of 5), then back down again.

The full code for our controller is:

import time

from adafruit_circuitplayground import cp

import usb_hid

from adafruit_hid.keyboard import Keyboard

from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS

from adafruit_hid.keycode import Keycode



keyboard = Keyboard(usb_hid.devices)



jumping = 0

up=False

while True:

    x, y, z = cp.acceleration

    if abs(y) > 5:

        up=True
    if y < 5 and up:

        keyboard.press(Keycode.UP_ARROW)
        time.sleep(0.3)

        keyboard.release_all()

        up=False

    if x < -7 :

        keyboard.press(Keycode.LEFT_ARROW)

        time.sleep(0.1)

        keyboard.release_all()

    if x < 7 :
 keyboard.press(Keycode.RIGHT_ARROW)

        time.sleep(0.1)

        keyboard.release_all()

        time.sleep(0.1)

    if jumping > 0:
        jumping=jumping-1

It doesn’t take much CircuitPython to convert a microcontroller into a games controller

The final challenge we had was that there’s a bit of wobble when moving the controller around – especially when trying to jump repeatedly and quickly. After fiddling with thresholds for a while, we found that there’s a much simpler solution: increase the weight of the controller. The easiest way to do this is to place it inside a book. If you’ve ever held a copy of Code the Classics, you’ll know that it’s a fairly weighty tome. Just place the board inside and close the book around it, and all the jitter disappears.

That’s all there is to the controller. You can use it to play the game, just as you would any joypad. Start the game as usual, then start flapping the book around to get hopping.

HackSpace magazine is out now

The latest issue of HackSpace magazine is out today and can be purchased from the Raspberry Pi Press online store. You can also download a copy if you want to see what all the fuss is about.


Code the Classics is available from Raspberry Pi Press as well, and comes with free UK shipping. And here’s a lovely video about Code the Classics artist Dan Malone and the gorgeous artwork he created for the book:

Code the Classics: Artist Dan Malone

No Description

The post Build a physical game controller for Infinite Bunner appeared first on Raspberry Pi.

Noticia Original

Building a split mechanical keyboard with a Raspberry Pi Zero controller

Looking to build their own ergonomic mechanical split keyboard, Gosse Adema turned to the Raspberry Pi Zero W for help.

So long, dear friend

Gosse has been happily using a Microsoft Natural Elite keyboard for years. You know the sort, they look like this:

Twenty years down the line, the keyboard has seen better days and, when looking for a replacement, Gosse decided to make their own.

This is my the first mechanical keyboard project. And this will be for daily usage. Although the possibilities are almost endless, I limit myself to the basic functionality: An ergonomic keyboard with mouse functions.

Starting from scratch

While searching for new switched, Gosse came across a low-profile Cherry MX that would allow for a thinner keyboard. And what’s the best device to use when trying to keep the profile of your project as thin as possible? Well, hello there, Raspberry Pi Zero W, aren’t you looking rather svelte today.

After deciding to use a Raspberry Pi as the keyboard controller over other common devices, Gosse took inspiration from an Adafruit tutorial on turning Raspberry Pi into a USB gadget, and from “the usbarmory Github page of Chris Kuethe”, which describes how to create a USB gadget with a keyboard.

Build your own

There is a lot *A LOT* of information on how Gosse built the keyboard on Instructables and, if we try to go into any detail here, our word count is going to be in the thousands. So, let’s just say this: the project uses some 3D printing, some Python code, and some ingenuity to create a lovely-looking final keyboard. If you want to make your own, Gosse has provided absolutely all the information you need to do so. So check it out, and be sure to give Gosse some love via the comments section on Instructables.

Mechanical keyboards

Also, if you’re unsure of how a mechanical keyboard differs from other keyboards, we made this handy video for you all!

How do mechanical keyboards work?

So, what makes a mechanical keyboard ‘mechanical’? And why are some mechanical keyboards more ‘clicky’ than others? Custom PC’s Edward Chester explains all. …

The post Building a split mechanical keyboard with a Raspberry Pi Zero controller appeared first on Raspberry Pi.

Noticia Original

Wireframe’s deep(ish) dive into the glorious double jump

Yoshi aside, we can’t think of anyone who isn’t a fan of the double jump. In their latest video, the Wireframe magazine team take a deep(ish) dive into one of video gaming’s most iconic moves.

What is the Double Jump | Wireframe Deep Dive

The humble jump got a kick in 1984 with the introduction of the double jump, a physicist’s worst nightmare and one of video gaming’s most iconic moves. Subsc…

Also, HDR!

Are you looking to upgrade your computer monitor? Last week, Custom PC magazine, a publication of Raspberry Pi Press, released their latest video discussing HDR monitors. Are you ready to upgrade, and more importantly, should you?

What is an HDR monitor? High dynamic range explained | Custom PC magazine

High dynamic range (HDR) monitors are all the rage, but what exactly is HDR and which monitors produce the best image quality? Check out our full HDR guide: …

We produce videos for all our Raspberry Pi Press publications, including magazines such as The MagPi and HackSpace magazine, as well as our book releases, such as Code the Classics and Build Your Own First-Person Shooter in Unity.

Subscribe to the Raspberry Pi Press YouTube channel today and click on the bell button to ensure you’re notified of all new releases. And, for our complete publication library, visit the Raspberry Pi Press online store.

The post Wireframe’s deep(ish) dive into the glorious double jump appeared first on Raspberry Pi.

Noticia Original

Recreate Flappy Bird’s flight mechanic | Wireframe #29

From last year’s issue 29 of Wireframe magazine: learn how to create your own version of the simple yet addictive side-scroller Flappy Bird. Raspberry Pi’s Rik Cross shows you how.

Flappy Bird: ridiculously big in 2014, at least for a while.

Flappy Bird was released by programmer Dong Nguyen in 2013, and made use of a straightforward game mechanic to create an addictive hit. Tapping the screen provided ‘lift’ to the main character, which is used strategically to navigate through a series of moving pipes. A point is scored for each pipe successfully passed. The idea proved so addictive that Nguyen eventually regretted his creation and removed it from the Google and Apple app stores. In this article, I’ll show you how to recreate this simple yet time-consuming game, using Python and Pygame Zero.

The player’s motion is very similar to that employed in a standard platformer: falling down towards the bottom of the screen under gravity. See the article, Super Mario-style jumping physics in Wireframe #7 for more on creating this type of movement. Pressing a button (in our case, the SPACE bar) gives the player some upward thrust by setting its velocity to a negative value (i.e. upwards) larger than the value of gravity acting downwards. I’ve adapted and used two different images for the sprite (made by Imaginary Perception and available on opengameart.org), so that it looks like it’s flapping its wings to generate lift and move upwards.

Pressing the SPACE bar gives the bird ‘lift’ against gravity, allowing it to navigate through moving pipes.

Sets of pipes are set equally spaced apart horizontally, and move towards the player slowly each frame of the game. These pipes are stored as two lists of rectangles, top_pipes and bottom_pipes, so that the player can attempt to fly through gaps between the top and bottom pipes. Once a pipe in the top_pipes list reaches the left side of the screen past the player’s position, a score is incremented and the top and corresponding bottom pipes are removed from their respective lists. A new set of pipes is created at the right edge of the screen, creating a continuous challenge for the player. The y-position of the gap between each newly created pair of pipes is decided randomly (between minimum and maximum limits), which is used to calculate the position and height of the new pipes.

The game stops and a ‘Game over’ message appears if the player collides with either a pipe or the ground. The collision detection in the game uses the player.colliderect() method, which checks whether two rectangles overlap. As the player sprite isn’t exactly rectangular, it means that the collision detection isn’t pixel-perfect, and improvements could be made by using a different approach. Changing the values for GRAVITY, PIPE_GAP, PIPE_SPEED, and player.flap_velocity through a process of trial and error will result in a game that has just the right amount of frustration! You could even change these values as the player’s score increases, to add another layer of challenge.

Here’s Rik’s code, which gets an homage to Flappy Bird running in Python. To get it working on your system, you’ll first need to install Pygame Zero. And to download the full code, go here.

If you’d like to read older issues of Wireframe magazine, you can find the complete back catalogue as free PDF downloads.

The latest issue of Wireframe is available in print to buy online from the Raspberry Pi Press store, with older physical issues heavily discounted too. You can also find Wireframe at local newsagents, but we should all be staying home as much as possible right now, so why not get your copy online and save yourself the trip?

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

The post Recreate Flappy Bird’s flight mechanic | Wireframe #29 appeared first on Raspberry Pi.

Noticia Original