element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • 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
  • Settings
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
Join Raspberry Pi Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 27 Aug 2015 9:56 AM Date Created
  • Views 3792 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 10 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 10 years ago +1
    Nice work! Well done.
  • balearicdynamics
    balearicdynamics over 10 years ago +1
    Well done ! With compliments Enrico
Parents
  • gadget.iom
    gadget.iom over 10 years ago

    Nice work! image

    Well done.

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

    Thanks!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Former Member
    Former Member over 10 years ago in reply to gadget.iom

    Thanks!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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 © 2025 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