Code Hyper Sports’ shooting minigame | Wireframe #35

Gun down the clay pigeons in our re-creation of a classic minigame from Konami’s Hyper Sports. Take it away, Mark Vanstone

Hyper Sports

Hyper Sports’ Japanese release was tied in with the 1984 Summer Olympics.

Hyper Sports

Konami’s sequel to its 1983 arcade hit, Track & Field, Hyper Sports offered seven games – or events – in which up to four players could participate. Skeet shooting was perhaps the most memorable game in the collection, and required just two buttons: fire left and fire right.

The display showed two target sights, and each moved up and down to come into line with the next clay disc’s trajectory. When the disc was inside the red target square, the player pressed the fire button, and if their timing was correct, the clay disc exploded. Points were awarded for being on target, and every now and then, a parrot flew across the screen, which could be gunned down for a bonus.

Making our game

To make a skeet shooting game with Pygame Zero, we need a few graphical elements. First, a static background of hills and grass, with two clay disc throwers each side of the screen, and a semicircle where our shooter stands – this can be displayed first, every time our draw() function is called.

We can then draw our shooter (created as an Actor) in the centre near the bottom of the screen. The shooter has three images: one central while no keys are pressed, and two for the directions left and right when the player presses the left or right keys. We also need to have two square target sights to the left and right above the shooter, which we can create as Actors.

When the clay targets appear, the player uses the left and right buttons to shoot either the left or right target respectively.

To make the clay targets, we create an array to hold disc Actor objects. In our update() function we can trigger the creation of a new disc based on a random number, and once created, start an animation to move it across the screen in front of the shooter. We can add a shadow to the discs by tracking a path diagonally across the screen so that the shadow appears at the correct Y coordinate regardless of the disc’s height – this is a simple way of giving our game the illusion of depth. While we’re in the update() function, looping around our disc object list, we can calculate the distance of the disc to the nearest target sight frame, and from that, work out which is the closest.

When we’ve calculated which disc is closest to the right-hand sight, we want to move the sight towards the disc so that their paths intersect. All we need to do is take the difference of the Y coordinates, divide by two, and apply that offset to the target sight. We also do the same for the left-hand sight. If the correct key (left or right arrows) is pressed at the moment a disc crosses the path of the sight frame, we register a hit and cycle the disc through a sequence of exploding frames. We can keep a score and display this with an overlay graphic so that the player knows how well they’ve done.

And that’s it! You may want to add multiple players and perhaps a parrot bonus, but we’ll leave that up to you.

Here’s Mark’s code snippet, which creates a simple shooting game in Python. To get it working on your system, you’ll need to install Pygame Zero. And to download the full code and assets, go here.

Get your copy of Wireframe issue 35

You can read more features like this one in Wireframe issue 35, 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 35 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 Code Hyper Sports’ shooting minigame | Wireframe #35 appeared first on Raspberry Pi.

Noticia Original

Digital Making at Home: Making games

When you’re part of the Raspberry Pi Foundation community, you’re a part of a global family of young creators who bring things to life with the power of digital making. We imagine that, given the current changes we’re all navigating, there are probably more of you who are interested in creating new and exciting things at home. And we want to help you! One of the best things we can do right now is to tap into what connects us as a community, and that’s digital making. So, welcome to Digital Making at Home from the Raspberry Pi Foundation!

Welcome to Digital Making at Home from the Raspberry Pi Foundation

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 Raspbe…

What is Digital Making at Home?

Whether you wrote your first line of code years ago or minutes ago, or you’ve yet to get started, with Digital Making at Home we’re inviting you on a digital making adventure each week.

Digital Making at Home from the Raspberry Pi Foundation V1

At the start of each week, we will share a theme that’s designed to jumpstart your journey of creative expression and problem solving where you create a digital making project you’re proud of. Every week, we’ll have code-along videos led by people from our team. They will walk you through projects from our free projects collection, to give you a place to start and a friendly face to accompany you!

a girl using Scratch on a laptop at home

For those of you whose mother language isn’t English, our free project guides are available in up to 30 languages so far.

Share your digital making project with us!

Each week, when you’ve made something you love using digital making, you can share it us! Just make sure you have your parent’s or guardian’s permissions first. Then share your project by filling out this form. You might find one of your projects featured in a future blog post for the whole community to see, but no matter what, we want to see what you created!

Just because we’re all at home, that doesn’t mean we can’t create together, so let’s kick off Digital Making at Home with this week’s theme:

This week, we’re making games

Playing a game is a fun way to pass the time, but why not take it to the next level and make your own game? This week, we invite you to create a game that you can play with your friends and family!

Let your imagination run free, and if you’re not sure where to start, here are three code-along videos to help you.

Beginner level

If you’re new to coding, we want to introduce you to Scratch, a block-based coding language that is perfect to start with.

Try out Archery, led by Mr C and his sidekick Xavier:

Digital Making at Home – [Archery] (beginner)

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 Raspbe…

Go to the free Archery project guide (available in 30 languages).

Intermediate level

If you’re looking to go beyond the Scratch surface, dive a little deeper into the coding language with.

Try out CATS!, led by Christina:

Digital Making at Home – [Cats] (intermediate)

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 Raspbe…

Go to the free CATS! project guide (available in 30 languages).

Advanced level

If you’re all Scratched out, move on to Python, a text-based coding language, to take things up a notch.

Try out Turtle Race, led by Marc:

Digital Making at Home – [Turtle Race] (advanced)

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 Raspbe…

Go to the free Turtle Race project guide (available in 30 languages).

More inspiration for making games

If you’re creating a game in Scratch, check out the extra videos from Mr C in the ‘Digital Making at Home: Making games’ playlist. These will show you how to add a timer, or a score, or a game over message, or a cool starter screen to any Scratch game!

A girl with her Scratch project

And if you’re into Python coding and hungry for more creative inspiration, we’ve got you covered. Our own Wireframe magazine, which you can download for free, has a ton of resources about making games. The magazine’s Source Code series shows you how to recreate an aspect of a classic game with a snippet of Python code, and you can read articles from that series on the Raspberry Pi blog. And if that’s still not enough, take a look at our Code the Classics book, which you can also download for free!

Alright friends, you’ve got all you need, so let’s get digital making!

Share your feedback

We’d love to know what you think of Digital Making at Home, so that we can make it better for you! Let us know your thoughts by filling in this form.

The post Digital Making at Home: Making games appeared first on Raspberry Pi.

Noticia Original

App note: Cable compensation of a primary-side-regulation power supply

Another tech note from Richtek on power supply regulation with cable compensation. Link here

Cable compensation has been used to compensate the voltage drop due to cable impedance for providing a regulated charging voltage in battery charger applications. This application note uses a novel cable compensation method, which called cable minus compensation, as an example to describe the concept and design criteria for the cable compensation of a PSR flyback converter. The analytic results are also verified by the simulation results.

from Dangerous Prototypes https://ift.tt/33VdvYz

App note: Analysis of buck converter efficiency

Tech note from Richtek on buck converter profiling. Link here

The synchronous buck circuit is wildly used to provide non-isolated power for low voltage and high current supply to system chip. To realize the power loss of synchronous buck converter and to improve efficiency is important for power designer. The application note introduces the analysis of buck converter efficiency and realizes major power component loss in synchronous buck converter.

from Dangerous Prototypes https://ift.tt/33UZEBo

The ArduINA226 power monitor

ArduPicLab published the details on how to build a current, voltage and power datalogger with Arduino and the INA226 module:

In the past I have developed various projects of ammeters based on Hall effect current sensors such as the ACS712, or on High-Side Current-Sense Amplifiers such as the MAX4080SASA or made with operational amplifiers. All these systems have an analog output which must then be digitized. The INA226 sensor has a digital output and incorporates a 16-bit ADC for which a high accuracy and precision is obtained.

from Dangerous Prototypes https://ift.tt/2wJbd2f

MCP4141 based digital potentiometer

Dilshan Jayakody has been working on an open-source hardware project MCP4141 based digital potentiometer, that is available on GitHub:

The main objective of this project is to create an experimental prototype of a digital potentiometer using Microchip’s MCP4141 IC. MCP4141 is available with end-to-end resistances of 5KΩ, 10KΩ, 50kΩ, and 100KΩ. This potentiometer-module can drive MCP4141 with any of the above mention resistances.

from Dangerous Prototypes https://ift.tt/2UJR3x1

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

How TED-Ed is helping families, students and teachers navigate the COVID-19 pandemic

In response to the COVID-19 pandemic’s unprecedented impact on education systems worldwide, TED’s award-winning youth and education initiative TED-Ed is focused on providing free, high-quality educational resources to millions of families around the globe. TED-Ed’s existing library of free, video-based lessons has been built by a network of 500,000 educators, spans all ages and subjects and features interactive lesson plans that complement thousands of TED-Ed Animations, TED Talks and other carefully curated educational videos.

By providing a variety of educational resources and engaging learning experiences, our hope is to help students, teachers and families replace feelings of anxiety, isolation, chaos and exhaustion with healthier and more sustainable feelings like curiosity, connectivity, predictability and rejuvenation. Here’s how you can follow along:

Announcing TED-Ed@Home

Launched last week, TED-Ed@Home is a daily newsletter that’s leveraging the collective expertise of thousands of TED speakers, TED-Ed educators and animators, and TED Translators to provide high-quality, online learning experiences for students, teachers and families everywhere — for free.

To get free daily lesson plans delivered to your inbox — organized by age group and spanning all subjects — sign up for the TED-Ed@Home newsletter. The newsletter features interactive, curiosity-invoking, video-based lessons around subjects commonly taught in school. The lessons are tagged to the appropriate grade levels, and subjects cover the arts, literature, language, math, science, technology and more. Most featured videos will offer translated subtitles in dozens of languages, and each lesson will include interactive questions, discussion prompts and materials to dig deeper. Teachers and parents can use the lessons as-is or easily customize them to meet their learners’ needs.

… and the TED-Ed Daily Challenge!

School closings don’t just keep students away from the classroom; they also keep students away from each other. While it’s critical that young people stay at home right now, it’s equally vital for students to see and hear from other young people — and for them to experience play in safe and meaningful ways.

On Instagram, we’re creating a fun way for students and their families to use their brains and common household items to creatively respond to educational challenges issued by TED speakers throughout the world. Each weekday at 2pm, head over to @tededucation for a brief educational talk and challenge from a new TED speaker. We’ll be handing over our account to TED speakers of all ages, who will use Instagram Stories and Instagram Live to deliver brief educational talks and issue creative, interactive, family-oriented challenges to Instagram users around the world. Viewers can respond using their own Instagram accounts, and TED-Ed will feature the most creative responses on our channel.

from TED Blog https://ift.tt/3dtAwGp

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