All posts by Alex Bate

Don’t forget about Steam Link on Raspberry Pi

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/dont-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.

Building a split mechanical keyboard with a Raspberry Pi Zero controller

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/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.

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

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/wireframes-deepish-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.

How to use a button with a Raspberry Pi

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/how-to-use-a-button-with-a-raspberry-pi/

Here’s our latest How to use video, showing you how to connect a button to your Raspberry Pi.

HOW TO USE a BUTTON with Raspberry Pi

Learn how to use a tactile button with your Raspberry Pi. They’re a great addition to any digital making project! Subscribe to our YouTube channel: http://rp…

Connect a button to Raspberry Pi

Attaching a button to your Raspberry Pi is a great way of introducing digital making into your coding experience. Use it to play music, turn lights on and off, or even shut down your device.

Follow our other How to use videos to learn how to use a servo motor, LED, and Raspberry Pi camera module with your Raspberry Pi. Try linking them together to build something grander, such as a digital camera, a robot, or a music box.

How to use Raspberry Pi

You’ll find a full list of our current How to use videos here – be sure to subscribe to our channel for more content as we release it.

The post How to use a button with a Raspberry Pi appeared first on Raspberry Pi.

Create Boing!, our Python tribute to Pong

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/create-boing-our-python-tribute-to-pong/

Following on from yesterday’s introduction to Pong, we’re sharing Boing!, the Python-based tribute to Pong created by Eben Upton exclusively for Code the Classics. Read on to get a detailed look at the code for Boing!

You can find the download link for the Boing! code in the Code the Classics book, available now in a variety of formats. Be sure to stick with today’s blog post until the end, for a special Code the Classics offer.

From Pong to Boing!

To show how a game like Pong can be coded, we’ve created Boing! using Pygame Zero, a beginner-friendly tool for making games in Python. It’s a good starting point for learning how games work – it takes place on a single screen without any scrolling, there are only three moving objects in the game (two bats and a ball), and the artificial intelligence for the computer player can be very simple – or even non-existent, if you’re happy for the game to be multiplayer only. In this case, we have both single-player and two-player modes.

The code can be divided into three parts. First, there’s the initial startup code. We import from other Python modules so we can use their code from ours. Then we check to make sure that the player has sufficiently up-to-date versions of Python and Pygame Zero. We set the WIDTH and HEIGHT variables, which are used by Pygame Zero when creating the game window. We also create two small helper functions which are used by the code.



The next section is the largest. We create four classes: Impact, Ball, Bat, and Game. The first three classes inherit from Pygame Zero’s Actor class, which amongst other things keeps track of an object’s location in the game world, and takes care of loading and displaying sprites. Bat and Ball define the behaviour of the corresponding objects in the game, while Impact is used for an animation which is displayed briefly whenever the ball bounces off something. The Game class’s job is to create and keep track of the key game objects, such as the two bats and the ball.

Further down, we find the update and draw functions. Pygame Zero calls these each frame, and aims to maintain a frame rate of 60 frames per second. Gameplay logic, such as updating the position of an object or working out if a point has been scored, should go in update, while in draw we tell each of the Actor objects to draw itself, as well as displaying backgrounds, text, and suchlike.



Our update and draw functions make use of two global variables: state and game. At any given moment, the game can be in one of three states: the main menu, playing the game, or the game-over screen. The update and draw functions read the state variable and run only the code relevant to the current state. So if state is currently State.MENU, for example, update checks to see if the SPACE bar or the up/down arrows are pressed and updates the menu accordingly, and draw displays the menu on the screen. The technical term for this kind of system is ‘finite state machine’.

The Game class’s job is to create and keep track of the key game objects

The game variable references an instance of the Game class as described above. The __init__ (constructor) method of Game optionally receives a parameter named controls. When we create a new Game object for the main menu, we don’t provide this parameter and so the game will therefore run in attract mode – in other words, while you’re on the main menu, you’ll see two computer-controlled players playing against each other in the background. When the player chooses to start a new game, we replace the existing Game instance with a new one, initialising it with information about the controls to be used for each player – if the controls for the second player are not specified, this indicates that the player has chosen a single-player game, so the second will be computer-controlled.

Two types of movement

In Boing!, the Bat and Ball classes inherit from Pygame Zero’s Actor class, which provides a number of ways to specify an object’s position. In this game, as well as games in later chapters, we’re setting positions using the x and y attributes, which by default specify where the centre of the sprite will be on the screen. Of course, we can’t just set an object’s position at the start and be done with it – if we want it to move as the game progresses, we need to update its position each frame. In the case of a Bat, movement is very simple. Each frame, we check to see if the relevant player (which could be a human or the computer) wants to move – if they do, we either subtract or add 4 from the bat’s Y coordinate, depending on whether they want to move up or down. We also ensure that the bat does not go off the top or bottom of the screen. So, not only are we only moving along a single axis, our Y coordinate will always be an integer (i.e. a whole number). For many games, this kind of simple movement is sufficient. Even in games where an object can move along both the X and Y axes, we can often think of the movement along each axis as being separate. For example, in the next chapter’s game, Cavern, the player might be pressing the right arrow key and therefore moving along the X axis at 4 pixels per frame, while also moving along the Y axis at 10 pixels per frame due to gravity. The movement along each axis is independent of the other.

Able to move at any angle, the ball needs to move at the same speed regardless of its direction

For the Ball, things get a bit more complicated. Not only can it move at any angle, it also needs to move at the same speed regardless of its direction. Imagine the ball moving at one pixel per frame to the right. Now imagine trying to make it move at a 45° angle from that by making it move one pixel right and one pixel up per frame. That’s a longer distance, so it would be moving faster overall. That’s not great, and that’s before we’ve even started to think about movement in any possible direction.

The solution is to make use of vector mathematics and trigonometry. In the context of a 2D game, a vector is simply a pair of numbers: X and Y. There are many ways in which vectors can be used, but most commonly they represent positions or directions.

You’ll notice that the Ball class has a pair of attributes, dx and dy. Together these form a vector representing the direction in which the ball is heading. If dx and dy are 1 and 0.5, then each time the ball moves, it’ll move by one pixel on the X axis and a half a pixel on the Y axis. What does it mean to move half a pixel? When a sprite is drawn, Pygame Zero will round its position to the nearest pixel. So the end result is that our sprite will move down the screen by one pixel every other frame, and one pixel to the right every frame (Figure 1).

We still need to make sure that our object moves at a consistent speed regardless of its direction. What we need to do is ensure that our direction vector is always a ‘unit vector’ – a vector which represents a distance of one (in this case, one means one pixel, but in some games it will represent a different distance, such as one metre). Near the top of the code you’ll notice a function named normalised. This takes a pair of numbers representing a vector, uses Python’s math.hypot function to calculate the length of that vector, and then divides both the X and Y components of the vector by that length, resulting in a vector which points in the same direction but has a length of one (Figure 2).

Vector maths is a big field, and we’ve only scratched the surface here. You can find many tutorials online, and we also recommend checking out the Vector2 class in Pygame (the library on top of which Pygame Zero is built).

Try Boing!

Update Raspbian to try Boing! and other Code the Classics games on your Raspberry Pi.

The full BOING! tutorial, including challenges, further explanations, and a link to the downloadable code can be found in Code the Classics, the latest book from Raspberry Pi Press.

We’re offering £1 off Code the Classics if you order it before midnight tomorrow from the Raspberry Pi Press online store. Visit the store now, or use the discount code PONG at checkout if you make a purchase before midnight tomorrow.

As always, Code the Classics is available as a free PDF from the Wireframe website, but we highly recommend purchasing the physical book, as it’s rather lovely to look at and would make a great gift for any gaming and/or coding enthusiast.

The post Create Boing!, our Python tribute to Pong appeared first on Raspberry Pi.

The History of Pong | Code the Classics

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/the-history-of-pong-code-the-classics/

One topic explored in Code the Classics from Raspberry Pi Press is the origin story and success of Pong, one of the most prominent games in early video game history.

‘The success of Pong led to the creation of Pong home consoles (and numerous unofficial clones) that could be connected to a television. Versions have also appeared on many home computers.’

Ask anyone to describe a game of table tennis and they’ll invariably tell you the same thing: the sport involves a table split into quarters, a net dividing the two halves, a couple of paddles, and a nice round ping-pong ball to bat back and forth between two players. Take a look at the 1972 video game Pong, however, and you’ll notice some differences. The table, for instance, is simply split in half and it’s viewed side-on, the paddles look like simple lines, and the ball is square. Yet no one – not even now – would have much trouble equating the two.

Back in the early 1970s, this was literally as good as it got. The smattering of low-powered arcade machines of the time were incapable of realistic-looking graphics, so developers had to be creative, hoping imaginative gamers would fill the gaps and buy into whatever they were trying to achieve. It helped enormously that there was a huge appetite for the new, emerging video game industry at that time. Nolan Bushnell was certainly hungry for more – and had he turned his nose up at Spacewar!, a space combat game created by Steve Russell in 1962, then Pong would never even have come about.

“The most important game I played was Spacewar! on a PDP-1 when I was in college,” he says, of the two-player space shooter that was popular among computer scientists and required a $120,000 machine to run. Although the visuals were nothing to write home about, the game was one of the first graphical video games ever made. It pitted two spaceships against each other and its popularity spread, in part, because the makers decided the code could be distributed freely to anyone who wanted it. “It was a great game, fun, challenging, but only playable on a very expensive computer late at night and the wee hours of the morning,” Nolan says. “In my opinion, it was a very important step.”

Nolan was so taken by Spacewar! that he made a version of the game with a colleague, Ted Dabney. Released in 1971, Computer Space allowed gamers to control a rocket in a battle against flying saucers, with the aim being to get more hits than the enemy in a set period of time. To make it attractive to players, it was placed in a series of colourful, space-age, moulded arcade cabinets. Nolan and Ted sold 1500 of them; even though they made just $500 from the venture, it was enough to spur them into continuing. They came up with the idea for Pong and created a company called Atari.

One of their best moves was employing engineer Al Alcorn, who had worked with Nolan at the American electronics company Ampex. Al was asked to create a table tennis game based on a similar title that had been released on the Magnavox Odyssey console, on the pretence that the game would be released by General Electric. In truth, Nolan simply wanted to work out Al’s potential, but he was blown away by what his employee came up with. Addictive and instantly recognisable, Atari realised Pong could be a major hit. The game’s familiarity with players meant it could be picked up and played by just about anyone.

Even so, Nolan had a hard time convincing others. Manufacturers turned the company down, so he visited the manager of a bar called Andy Capp’s in Sunnyvale, California and asked them to take Pong for a week. The manager soon had to call Nolan to tell him the machine had broken: it had become stuffed full of quarters from gamers who loved the game. By 1973, production of the cabinet was in overdrive and 8000 were sold. It led to the creation of a Pong home console which sold more than 150,000 machines. People queued to get their hands on one and Atari was on its way to become a legendary games company.

For Nolan, it was justification for his perseverance and belief. Suddenly, the man who had become interested in electronics at school, where he would spend time creating devices and connecting bulbs and batteries, was being talked of as a key player in the fledgling video game industry. But what did Nolan, Ted, Al, and the rest of the Atari team do to make the game so special? “We made it a good, solid, fun game to play,” says Nolan. “And we made it simple, easy, and quickly understood. Keeping things simple is more difficult to do than building something complex. You can’t dress up bad gameplay with good graphics.”

Making Pong

On the face of it, Pong didn’t look like much. Each side had a paddle that could be moved directly up and down using the controller, and the ball would be hit from one side to the other. The score was kept at the top of the screen and the idea was to force the opposing player to miss. It meant the game program needed to determine how the ball was hit and where the ball would go from that point. And that’s the crux of Pong’s success: the game encouraged people to keep playing and learning in the hope of attaining the skills to become a master.

When creating Pong, then, the designers had a few things in mind. One of the most important parts of the game was the movement of the paddles. This involved a simple, vertical rectangle that went up and down. One of the benefits Atari had when it created Pong was that it controlled not just the software but the hardware too. By building the cabinet, it was able to determine how those paddles should be moved. “The most important thing if you want to get the gameplay right is to use a knob to move the paddle,” advises Nolan. “No one has done a good Pong using touchscreens or a joystick.”

Look at a Pong cabinet close up – there are plenty of YouTube videos which show the game in action on the original machine – and you will see what Nolan means. You’ll notice that players turned a knob anticlockwise to move the paddle down, and clockwise to move it up. Far from being confusing, it felt intuitive.

Movement of the ball

With the paddles moving, Atari’s developers were able to look at the movement of the ball. At its most basic, if the ball continued to make contact with the paddles, it would constantly move back and forth. If it did not make contact, then it would continue moving in the direction it had embarked upon and leave the screen. At this stage, a new ball was introduced in the centre of the screen and the advantage was given to the player who had just chalked up a point. If you watch footage of the original Pong, you will see that the new ball was aimed at the player who had just let the ball go past. There was a chance he or she would miss again.

To avoid defeat, players had to be quite nifty on the controls and stay alert. Watching the ball go back and forth at great speed could be quite mesmerising as it left a blurred trail across the cathode ray tube display. There was no need to waste computing power by animating the ball because the main attention was focused on what would happen when it collided with the paddle. It had to behave as you’d expect. “The game did not exist without collisions of the ball to the paddle,” says Nolan.

Al realised that the ball needed to behave differently depending on where it hit the paddle. When playing a real game of tennis, if the ball hits the centre of the racket, it will behave differently from a ball that hits the edge. Certainly, the ball is not going to be travelling in a simple, straight path back and forth as you hit it; it is always likely to go off at an angle. This, though, is the trickiest part of making Pong “The ball should bounce up from an upper collision with more obtuse angles as the edge of the paddle is approached,” Nolan says. “This balances the risk of missing with the fact that an obtuse angle is harder to return.” This is what Pong is all about: making sure you hit the ball with the paddle, but in a manner that makes it difficult for the opposing player to return it. “A player wants the ball to be just out of reach for the opponent or be hard for him or her to predict.”

Read on…

This post is part of a much longer deep dive into the history of Pong in Code the Classics, our 224-page hardback book that not only tells the stories of some of the seminal video games of the 1970s and 1980s, but also shows you how to use Python and Pygame Zero to create your own games inspired by them, following examples programmed by Raspberry Pi founder Eben Upton.

In conjunction with today’s blog post, we’re offering £1 off Code the Classics when you order your copy between now and midnight Wednesday 26 Feb 2020 from the Raspberry Pi Press online store. Simply follow this link or enter the discount code PONG at checkout to get your copy for only £11, with free shipping in the UK.

Code the Classics is also available as a free download, although the physical book is rather delightful, so we really do recommend purchasing it.

The post The History of Pong | Code the Classics appeared first on Raspberry Pi.

Build a Raspberry Pi Zero W Amazon price tracker

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/build-a-raspberry-pi-zero-w-amazon-price-tracker/

Have you ever missed out on a great deal on Amazon because you were completely unaware it existed? Are you interested in a specific item but waiting for it to go on sale? Here’s help: Devscover’s latest video shows you how to create an Amazon price tracker using Raspberry Pi Zero W and Python.

Build An Amazon Price Tracker With Python

Wayne from Devscover shows you how to code a Amazon Price Tracker with Python! Get started with your first Python project. Land a job at a big firm like Google, Facebook, Twitter or even the less well known but equally exciting big retail organisations or Government with Devscover tutorials and tips.

By following their video tutorial, you can set up a notification system on Raspberry Pi Zero W that emails you every time your chosen item’s price drops. Very nice.

Devscover’s tutorial is so detailed that it seems a waste to try and summarise it here. So instead, why not make yourself a cup of tea and sit down with the video? It’s worth the time investment: if you follow the instructions, you’ll end up with a great piece of tech that’ll save you money!

Remember, if you like what you see, subscribe to the Devscover YouTube channel and give them a thumbs-up for making wonderful Raspberry Pi content!

The post Build a Raspberry Pi Zero W Amazon price tracker appeared first on Raspberry Pi.

Build a Raspberry Pi laser scanner

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/build-a-raspberry-pi-laser-scanner/

You really don’t need anything too fancy to build this Raspberry Pi laser scanner, and that’s why we think it’s pretty wonderful.

Rasperry Pi 3D Laser Scanner

Cornell University: ECE 5725 Michael Xiao and Thomas Scavella

Building a Raspberry Pi laser scanner

The ingredients you’ll need to build the laser scanner are:

  • Raspberry Pi
  • Raspberry Pi Camera Module v2
  • Stepper motor and driver
  • Line laser
  • Various LEDs, resistors, and wires
  • Button

To complete the build, access to a 3D printer and laser cutter would come in handy. If you don’t have access to such tools, we trust you to think of an alternative housing for the scanner. You’re a maker, you’re imaginative — it’s what you do.

How does the laser scanner work?

The line laser projects a line an object, highlighting a slice of it. The Raspberry Pi Camera Module captures this slice, recording the shape of the laser line on the object’s surface. Then the stepper motor rotates the object. When the object has completed a full rotation and the camera has taken an image of every slice, the Raspberry Pi processes all the images to create one virtual 3D object.

Instructables user mfx2 has written a wonderful tutorial for the project, which also includes all files needed to build and program your own version.

The post Build a Raspberry Pi laser scanner appeared first on Raspberry Pi.

3D-printable Raspberry Pi bits and pieces you should totally make

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/3d-printable-raspberry-pi-bits-and-pieces-you-should-totally-make/

Recently, we’ve seen an awful lot of new designs online for 3D-printable Raspberry Pi cases and add-ons. Here are a few that definitely need your attention.

Turbine RGB Lamp

Described as “a Turbine-fin Lamp with some RGB Neopixels in the middle,” this print from Thingiverse user kryptn would be a rather lovely addition to any desk or bedside table.

NASs…NASi?

These two lovely network-attached storage (NAS) prints will allow you to store your files via your network…it’s all in the name.


While araymbox’s PiNAS takes a more traditional approach to the NAS aesthetic, harrytheb’s UFO NAS casing is a little out of this world.

Tiny Raspberry Pi Zero Case with Antenna

The internet is crowded with Raspberry Pi cases you can print, but few are as eye-catching at this Raspberry Pi Zero case by jwillmer.

IKEA Skadis Shelf

The IKEA Skadis system is becoming more and more popular in workshops, studies, and craft rooms. So why not print this perfectly-sized shelf to fit your Raspberry Pi and official Raspberry Pi case into the system as well?

Raspberry Pi 4 cooling stand

Is this cheating? You can use this file to 3D-print your own version of the Raspberry Pi 4 cooling stand that we’re currently giving away for free on the front of The MagPi magazine.

Share your own

If you’ve designed any 3D-printable Raspberry Pi accessories, share them with us in the comments below!

Bonus content

3D PRINTING INFILL PATTERNS – What, why, and why not! || HackSpace magazine

There’s more than one option when it comes to selecting infill patters for your 3D prints. But what are the differences, and why should you use one over the …

The post 3D-printable Raspberry Pi bits and pieces you should totally make appeared first on Raspberry Pi.

How to use an LED with Raspberry Pi

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/how-to-use-an-led-with-raspberry-pi/

Learn how to use an LED with Raspberry Pi in our latest How to use video on YouTube.

HOW TO USE an LED with Raspberry Pi

Subscribe to our YouTube channel: http://rpf.io/ytsub Help us reach a wider audience by translating our video content: http://rpf.io/yttranslate Buy a Raspberry Pi from one of our Approved Resellers: http://rpf.io/ytproducts Find out more about the #RaspberryPi Foundation: Raspberry Pi http://rpf.io/ytrpi Code Club UK http://rpf.io/ytccuk Code Club International http://rpf.io/ytcci CoderDojo http://rpf.io/ytcd Check out our free online training courses: http://rpf.io/ytfl Find your local Raspberry Jam event: http://rpf.io/ytjam Work through our free online projects: http://rpf.io/ytprojects Do you have a question about your Raspberry Pi?

Using LEDs

LEDs (light-emitting diodes) are incredibly useful in digital making projects. You can use one to indicate whether a script is running or when an action can take place, or as decoration, and for so much more besides.

Blinking an LED with the help of Raspberry Pi has become a rite of passage for new digital makers: it’s the physical equivalent of the ‘hello world’ program! Therefore, it’s the first thing that the participants in our Picademy training, and many young people in physical computing sessions at coding clubs in our networks, learn how to do.

Follow the steps in our latest How to use video to learn how to control an LED with your Raspberry Pi, and go get making.

More Raspberry Pi videos

You can find the How to use YouTube playlist here, and you can subscribe to our channel and never miss a video!

And, while you’re in a subscribe-y mood, also subscribe to the Raspberry Pi Press YouTube channel, the home of all content from The MagPi, HackSpace magazine, WireFrame, Custom PC, and more.

The post How to use an LED with Raspberry Pi appeared first on Raspberry Pi.

USA magazine subscriptions offer: 48% off standard prices

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/usa-magazine-subscriptions-offer-48-off-standard-prices/

Today we’re launching a time-limited special offer on subscriptions to HackSpace magazine and The MagPi magazine for readers in the USA, saving you a whopping 48% compared to standard overseas subscriptions. We want to help as many people as possible get their hands on our fantastic publications.

Starting today, you can subscribe to these magazines for the discounted price of $60 a year – just $5 per issue. Not only will you receive twelve issues direct to your door, but you’ll also receive a free gift and save up to 35% compared with newsstand prices!

You’ll need to be quick – this discounted offer is only running until 31 March 2020.

HackSpace magazine

HackSpace magazine is packed with projects for fixers and tinkerers of all abilities. We’ll teach you new techniques and give you refreshers on familiar ones, from 3D printing, laser cutting, and woodworking to electronics and the Internet of Things. HackSpace magazine will inspire you to dream bigger and build better.

Your $60 subscription will get you twelve issues per year and a free Adafruit Circuit Playground Express, worth $25. Click here to subscribe today!

The MagPi magazine

The MagPi is the official Raspberry Pi magazine. Written by and for the community, it’s packed with Raspberry Pi-themed projects, computing and electronics tutorials, how-to guides, and the latest news and reviews.

Your $60 subscription will get you twelve issues per year and a free Raspberry Pi Zero W with accessories. Click here to subscribe today!

The post USA magazine subscriptions offer: 48% off standard prices appeared first on Raspberry Pi.

3D printing infill patterns — what, why, and why not!

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/3d-printing-infill-patterns-what-why-and-why-not/

How many types of infill pattern have you tried? The latest video from Raspberry Pi Press takes a closer look at 3D printing infill patterns, and why you may want to use a certain pattern over another.

3D PRINTING INFILL PATTERNS – What, why, and why not! || HackSpace magazine

There’s more than one option when it comes to selecting infill patters for your 3D prints. But what are the differences, and why should you use one over the other? #HackSpacemagazine is the monthly magazine for people who love to make things and those who want to learn.

Raspberry Pi Press publishes a variety of magazines and books, and the Raspberry Pi Press YouTube channel covers them all. Subscribe today to keep up to date with all new video releases, and let us know in the video comments what other content you’d like to see.

The post 3D printing infill patterns — what, why, and why not! appeared first on Raspberry Pi.

Cats and lasers and (Raspberry) Pi, OH MY!

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/cats-and-lasers-and-raspberry-pi-oh-my/

Keeping a modern cat entertained requires something more high-tech than a ball of yarn. The MagPi’s Phil King wonders if this is a purr-fect project…

WARNING! LASER EYE! Don’t look into a laser beam, and don’t point a laser beam at a somebody’s head. For more on things you SHOULDN’T do with a laser, visit magpi.cc/lasersafety.

Xander the cat is a much-loved family pet, but as his owners live in a flat, he can get a little bored staying indoors when they’re out at work. Seeking a way to keep his cat entertained, Enzo Calogero came up with an ingenious Raspberry Pi–powered project. “We noticed that he loves to chase a laser light, so we decided to create a device to make laser games for him,” explains Enzo.

The result is the Tri-Lasers for Felines device which, when the cat’s presence is detected by a PIR motion sensor, beams a laser dot around the room for Xander to chase between randomly generated points. Judging by the video on the project’s Hackster tutorial page, he seems to love it.

trilaser

This video is about trilaser

Pan and tilt

The laser’s main movement trajectory is handled by mounting it on a Pan-Tilt HAT, which has vertical and horizontal servo motors. “A pair of coordinates (x, y) is generated randomly,” explains Enzo. “The laser point moves from the current point to a new coordinate, following the segment that connects the two points, at a speed defined by a status variable. Once the new coordinates are reached, we loop back to point one.”

To add extra interest for Xander, its movement is randomised further by switching between three laser diodes to perform micro random movements very quickly. “Switching the active laser among the three allows extremely rapid movements of the laser dot, to create an extra variability of the light trajectories which seems more enjoyable for the cat,” says Enzo.

While the laser point is visible in daylight, it shows up better when there’s less light: “Xander prefers it when the room is completely dark.”

The device’s three laser diodes are set into a 3D-printed triangular holder that sits atop the Pan-Tilt HAT’s acrylic mount — which would normally be used to hold a Camera Module. Enzo also designed and 3D-printed a case for the PIR sensor.

Cat-a-log

In addition to handling laser movement, the Python script saves a log of Xander’s activity: “We check it now and then out for curiosity,” says Enzo. “When Xander was a kitten, he was playing with it very often. Now he is a bit older and much more prone to sleep rather than play, we switch it on when we are out in the evening to keep him busy during our prolonged absence.”

One issue that came up is that, being naturally curious animals, cats are prone to investigate any new objects. “We try to put it as high and unreachable as possible, but cats are extremely skilled,” says Enzo. “So, he was able to reach the device few times. And the best way to save the device from cat attacks is to make it as still as possible, so the cat loses interest.”

Therefore a tilt sensor was added to the device, to cause it to shut down if triggered by an inquisitive Xander, thus reducing the risk of damage.

This isn’t the only feline-focused project from Enzo, who has also built an IoT food scale to monitor when and how much Xander eats, sending the data to a Google Cloud online dashboard. He’s now working on a wheeled robot to track the cat with a camera and perform a few interactions — we wonder what Xander will make of that.

More from The MagPi

The MagPi magazine is available from newsagents in the UK, Barnes & Noble in the US, the Raspberry Pi Store here in Cambridge, and online in the Raspberry Pi Press store.

This month’s issue comes with a free stand for your Raspberry Pi 4. Yay!

A note from Alex regarding cats and lasers

Some cats don’t like lasers. They find it far too upsetting when they can’t catch what it is they’re chasing. If your cat starts to pant while chasing lasers, don’t assume it’s just exhausted. Panting can be a sign of stress in cats, and stressed is something your cat shouldn’t be. Exercise caution when playing with your cat and laser toys, and consult a vet if you’re unsure whether their behaviour is normal.

Signed,

The owner of a cat who doesn’t like laser toys

The post Cats and lasers and (Raspberry) Pi, OH MY! appeared first on Raspberry Pi.

How to use a servo motor with Raspberry Pi

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/how-to-use-a-servo-motor-with-raspberry-pi/

Learn how to use a servo motor with Raspberry Pi in our latest How to use video on YouTube.

HOW TO USE a servo motor with Raspberry Pi

Subscribe to our YouTube channel: http://rpf.io/ytsub Help us reach a wider audience by translating our video content: http://rpf.io/yttranslate Buy a Raspberry Pi from one of our Approved Resellers: http://rpf.io/ytproducts Find out more about the #RaspberryPi Foundation: Raspberry Pi http://rpf.io/ytrpi Code Club UK http://rpf.io/ytccuk Code Club International http://rpf.io/ytcci CoderDojo http://rpf.io/ytcd Check out our free online training courses: http://rpf.io/ytfl Find your local Raspberry Jam event: http://rpf.io/ytjam Work through our free online projects: http://rpf.io/ytprojects Do you have a question about your Raspberry Pi?

Over the next few months, we’ll be releasing more videos in our How to use series, including guides on the use of LEDs, buzzers, and sensors with your Raspberry Pi.

What other components do you think we should cover? While we can’t make videos for every available component on the market, we’d love to hear what you, our community, believe to be integral to the maker toolkit.

You can find the How to use YouTube playlist here, and you can subscribe to our channel and never miss a video!

And, while you’re in a subscribe-y mood, also subscribe to the Raspberry Pi Press YouTube channel, the home of all content from The MagPi, HackSpace magazine, WireFrame, Custom PC, and more.

The post How to use a servo motor with Raspberry Pi appeared first on Raspberry Pi.

Build your own first-person shooter in Unity

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/build-your-own-first-person-shooter-in-unity/

Raspberry Pi Press is back with a new publication: this time, it’s Wireframe’s time to shine, with Build Your Own First-Person Shooter in Unity.

BUILD YOUR OWN first-person shooter game in Unity || Wireframe magazine

Ever fancied creating your own first-person shooter game? Now you can with Wireframe’s brand new, 140-page bookazine, which positively heaves with tutorials and advice from expert video game developers!

Could you build a video game?

We’ve all had that moment of asking ourselves, “I wonder if I could do this?” when playing a video game. Whether as a child racing friends in Mario Kart, or in more recent years with vast open-world masterpieces, if you like games, you’ve probably thought about designing and building your own.

So, why don’t you?

With the latest publication from Wireframe and Raspberry Pi Press, you can learn how to use Unity, free software available to download online, to create your very own first-person shooter. You could build something reminiscent of DOOM, Wolfenstein, and all the other games you tried to convince your parents you were old enough to play when you really weren’t (who knew blurry, pixelated blood could be so terrifying?).

Build Your Own First-Person Shooter in Unity

Build Your Own First-Person Shooter in Unity leads you step-by-step through the process of making the game Zombie Panic – a frenetic battle for survival inside a castle heaving with the undead.

You’ll learn how to set up and use all the free software you’ll need, make enemies that follow and attack the player, create and texture 3D character models, and design levels with locked doors and keys.

You’ll also get tips and advice from experts, allowing you to progress your game making beyond the tutorials in the book.

Get your copy now!

Build Your Own First-Person Shooter in Unity is available now from the Raspberry Pi Press online store with free worldwide shipping, from the Raspberry Pi Store in Cambridge, and as a free download from the Wireframe website.

Wait, a free download?

Yup, you read correctly. Build Your Own First-Person Shooter in Unity can be downloaded for free as a PDF from the Wireframe website. We release free PDF versions of our books and magazines on the day they’re published; it means as many people as possible can get their hands on high-quality, up-to-date information about computing, programming and making.

However, when you buy our publications, you help us produce more great content, and you support the work of the Raspberry Pi Foundation to bring computing and digital making to people all over the world. We offer a variety of subscription options, including some terrific free gifts. And we make sure our publications are printed to feel good in your hands and look good on your bookshelf.

So, buy Build Your Own First-Person Shooter in Unity if you can – thank you, you’re amazing! And if not, grab the free PDF. Whichever you choose, we hope you make an awesome game. Don’t forget to share it with us on our social media channels.

The post Build your own first-person shooter in Unity appeared first on Raspberry Pi.

Our brand-new HackSpace magazine trailer

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/our-brand-new-hacksapce-magazine-trailer/

Our brand-new trailer for HackSpace magazine is very pretty. Here, have a look for yourself.

THIS IS MAKING || Hackspace magazine

HackSpace magazine is the new monthly magazine for people who love to make things and those who want to learn. Grab some duct tape, fire up a microcontroller, ready a 3D printer and hack the world around you!

As we mentioned last week, this month’s HackSpace magazine contains a very cool Raspberry Pi special feature that we know you’ll all love.

HackSpace magazine is available at major newsagents in the UK, at the Raspberry Pi store, Cambridge, at Barnes & Noble in the US, and in our online store.

You can also download the latest issue as a free PDF, so if you’re new to HackSpace, there really is no reason not to give it a go. We know you’re going to love it.

The post Our brand-new HackSpace magazine trailer appeared first on Raspberry Pi.

Can you connect a Raspberry Pi to a GoPro Hero 6?

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/can-you-connect-a-raspberry-pi-to-a-gopro-hero-6/

A contractor is drilling in the office space above ours, and it sounds like we’re under attack by a swarm of very angry, Transformeresque bees. We can’t hear ourselves think. Although we can hear the drills.

Because of this disruption, I (Alex) am unable to focus on words. [Ed’s note: me too. We apologies for any typos.] So here you go. Have an interesting video from YouTuber Blitz City DIY.

Can you help Liz create a wireless monitor for her GoPro Hero 6 using VLC on a Raspberry Pi despite the latest changes to GoPro software?

DIY FYI: GoPro and Wi-Fi

I wanted to create a wireless monitor for my GoPro Hero 6 using VLC on a Raspberry Pi but immediately ran into issues concerning Wi-Fi on the newer GoPro models (basically the GoPro Hero 4 and up).

Reply in the comments of the video, or here if you don’t have a YouTube account. Meanwhile, I will slowly be losing my mind, cowering under my desk with my fingers in my ears.

The post Can you connect a Raspberry Pi to a GoPro Hero 6? appeared first on Raspberry Pi.

What was your first Raspberry Pi project?

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/what-was-your-first-raspberry-pi-project/

Quick and simple blog post today: what was your first Raspberry Pi project? Or, if you’ve yet to enter the world of Raspberry Pi ownership, what would you like to do with your Raspberry Pi once you get one?

Answer in the comments below, or on Twitter using #MyFirstRaspberryPi. Photos aren’t necessary, but always welcome (of the project, not of, like, you and your mates in Ibiza circa 2001).

Share your story to receive ten imaginary house points (of absolutely no practical use, but immense emotional value) and a great sense of achievement looking at how far you’ve come.

The post What was your first Raspberry Pi project? appeared first on Raspberry Pi.

HackSpace’s 25 ways to use a Raspberry Pi

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/hackspaces-25-ways-to-use-a-raspberry-pi/

The latest issue of HackSpace magazine is out today, and it features a rather recognisable piece of tech on the front cover.

25 ways of using this tiny computer

From personal computing and electronic fashion to robotics and automatic fabrication, Raspberry Pi is a rather adaptable piece of kit. And whether you choose to use the new Raspberry Pi 4, or the smaller, $5 Raspberry Pi Zero, there are plenty of projects out there for even the most novice of hobbyists to get their teeth into.

This month’s HackSpace magazine, a product of Raspberry Pi Press, is packed full of some rather lovely Raspberry Pi projects, as well as the magazine’s usual features from across the maker community. So, instead of us sharing one of the features with you, as we usually do on release day, we wanted to share them all with you.

Free PDF download

Today’s new issue of HackSpace is available  as a free PDF download, and, since you’re reading this post, I imagine you’re already a Raspberry Pi fan, so it makes sense you’ll also like this magazine.

So download the free PDF (the download button is below the cover image) and let us know what you think of HackSpace magazine in the comments below.

More from HackSpace magazine

If you enjoy it and want to read more, you can get a HackSpace magazine subscription or purchase copies from Raspberry Pi Press online store, from the Raspberry Pi store, Cambridge, or from your local newsagent.

As with all our magazines, books, and hardware, every purchase of HackSpace magazine funds the charitable work of the Raspberry Pi Foundation. So if you enjoy this free PDF, please consider purchasing future issues. We’d really appreciate it.

The post HackSpace’s 25 ways to use a Raspberry Pi appeared first on Raspberry Pi.

Citizen science traffic monitoring with Raspberry Pi

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/citizen-science-traffic-monitoring-with-raspberry-pi/

Homes in Madrid, Dublin, Cardiff, Ljubljana, and Leuven are participating in the Citizens Observing UrbaN Transport (WeCount) project, a European Commission–funded research project investigating sustainable economic growth.

1,500 Raspberry Pi traffic sensors will be distributed to homes in the five cities to gather data on traffic conditions. Every hour, the devices will upload information to publically accessible cloud storage. The team behind WeCount says:

Following this approach, we will be able to quantify local road transport (cars, heavy goods vehicles, active travel modes, and speed), produce scientific knowledge in the field of mobility and environmental pollution, and co-design informed solutions to tackle a variety of road transport challenges.

“With air pollution being blamed for 500,000 premature deaths across the continent in 2018,” states a BBC News article about the project, “the experts running the survey hope their results can be used to make cities healthier places to live.” Says the WeCount team:

[T]he project will provide cost-effective data for local authorities, at a far greater temporal and spatial scale than what would be possible in classic traffic counting campaigns, thereby opening up new opportunities for transportation policy making and research.

Find more information about the WeCount project on the BBC News website and on the the CORDIS website.

Raspberry Pi makes the ideal brain

The small form factor and low cost of Raspberry Pi mean it’s the ideal brain for citizen science projects across the globe, including our own Raspberry Pi Oracle Weather Station.

Build Your Own weather station kit assembled

While the original Oracle Weather Station programme involved only school groups from across the world, we’ve published freely accessible online guides to building your own Raspberry Pi weather station, and to uploading weather data to the Initial State platform.

Penguin Watch

Another wonderful Raspberry Pi–powered citizen science project is Penguin Watch, which asks the public to, you guessed it, watch penguins. Time-lapse footage — obtained in the Antarctic by Raspberry Pi Camera Modules connected to Raspberry Pi Zeros — is uploaded to the Penguin Watch website, and anyone in the world can go online to highlight penguins in the footage, helping the research team to monitor the penguin population in these locations.

Setting up. Credit: Alasdair Davies, ZSL

Penguin Watch is highly addictive and it’s for a great cause, so be sure to check it out.

The post Citizen science traffic monitoring with Raspberry Pi appeared first on Raspberry Pi.