element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Achievement Levels
    • Benefits of Membership
    • Feedback and Support
    • Members Area
    • Personal Blogs
    • What's New on element14
  • Learn
    Learn
    • eBooks
    • Learning Center
    • Learning Groups
    • STEM Academy
    • Webinars, Training and Events
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Arduino Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Project Groups
    • Raspberry Pi Projects
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Or choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Raspberry Pi Projects
  • Products
  • Raspberry Pi
  • Raspberry Pi Projects
  • More
  • Cancel
Raspberry Pi Projects
Blog Using A Raspberry Pi and Node-Red to Make A Game
  • Blog
  • Documents
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Raspberry Pi Projects requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 27 Aug 2015 9:56 AM Date Created
  • Views 2510 views
  • Likes 5 likes
  • Comments 6 comments
  • classroom
  • node_js
  • internet_of_things
  • node_red
  • raspberry_pi_projects
Related
Recommended

Using A Raspberry Pi and Node-Red to Make A Game

Former Member
Former Member
27 Aug 2015

By LDR (9 years old) (+dad)

image

Introduction


In this game, you roll coins down a ramp onto a board with foil islands. When the coins make a bridge from one side to the other, it is a complete circuit and an LED lights up.

 

image

Simple series circuit with LED. The coins make a conducting ‘bridge’ across the foil ‘islands.’


Version 1


First, I cut out the box and the foil islands. Then I stuck the islands onto the box and two rails along two opposite sides with glue. We made a circuit that made a LED light up and connected that to the rails with paper clips.

 

When coins made a “bridge” between the islands, the electricity flows and lets the LED light up. (We soaked the coins in vinegar to make them shiny and conduct well).

 

I made a ramp to roll the coins down out of cardboard and the game worked….

 

But not well enough!


Version 2 (writing the Node-Red)


We improved the game using a Raspberry Pi and Node-Red. I wanted a timer to make the game more exciting. We had a traffic light, so I used that by putting it straight onto the output pins of the Raspberry Pi.

 

We connected the two side rails to input pins on the Raspberry Pi so that it could tell if the coins had made the circuit complete.

 

I used a buzzer to tell you when the time was up.

 

I also used a switch to start the game. The green light went on for 20 seconds. Then the amber light came on for 20 seconds. Then the red light came on for 20 seconds. Finally, the buzzer went off.

 

If the coins made a bridge before the time was up, all of the LEDs flashed.

 

image

 

The Node Red code showing the start switch sequence and the ‘you won’ sequence.


Finally


The game is fun to make and fun to play. It is a good project because it teaches you how to programme a real game, not just on the screen.

 

image

 

The full Node-Red version

 

 

LDR (9 years old)

  • Sign in to reply

Top Comments

  • drlucyrogers
    drlucyrogers over 8 years ago +1
    Well done LDR (and Dad)! This looks like a great game, and a great use of Node Red and a Raspberry Pi - I look forward to seeing your next project.
  • gadget.iom
    gadget.iom over 8 years ago +1
    Nice work! Well done.
  • balearicdynamics
    balearicdynamics over 8 years ago +1
    Well done ! With compliments Enrico
  • spannerspencer
    spannerspencer over 8 years ago

    Great work! Love that you've put a single board computer to use in making a game that doesn't need a screen. Maybe there's a way to keep score with it, too?

     

    Is this your first Raspberry Pi project internetofclassroomthings? I still have a copy of The MagPi here, that'll help you keep on making such awesome things -- if you put your postal address into your profile, I'd be happy to send you a copy image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 8 years ago in reply to balearicdynamics

    Thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 8 years ago in reply to gadget.iom

    Thanks!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 8 years ago

    Well done ! With compliments image

     

    Enrico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • gadget.iom
    gadget.iom over 8 years ago

    Nice work! image

    Well done.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube