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
Cheer Us Up
  • Challenges & Projects
  • Project14
  • Cheer Us Up
  • More
  • Cancel
Cheer Us Up
Blog Basic HTML games hosted on the Raspberry Pi Pico
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cheer Us Up to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: kk99
  • Date Created: 13 Apr 2021 8:41 PM Date Created
  • Views 3487 views
  • Likes 9 likes
  • Comments 2 comments
  • cheerusupch
  • raspberry pi pico
  • retro games
Related
Recommended

Basic HTML games hosted on the Raspberry Pi Pico

kk99
kk99
13 Apr 2021
image

Cheer Us Up

Enter Your Electronics & Design Project for a chance to win a $200 shopping cart!

Submit an EntrySubmit an Entry  Back to homepage image
Project14 Home
Monthly Themes
Monthly Theme Poll

image

Browsing projects based on the Raspberry Pi Pico I have found one which uses the TinyUSB and IwIP projects to create simple web client or server available via emulated USB ethernet. This example is documented and available here: https://github.com/maxnet/pico-webserver. I have decided to modify little this example to host basic HTML games on the Raspberry Pi Pico. I have found nice examples of basic HTML games here: https://gist.github.com/straker/. I have create simple index.html page with links to few HTML games. Below there is source code of this page:

<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}

.bg-image {
background-image: url("backgorund.jpg");
height: 1024px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}

.bg-text {
text-align: center;
;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}

</style>
</head>
<body>
<div>
<div>
<h1 style="font-size:50px">Basic HTML games</h1>
<form>
<button type="submit" formaction="breakout.html">Breakout</button>
<button type="submit" formaction="frogger.html">Frogger</button>
<button type="submit" formaction="pong.html">Pong</button>
<button type="submit" formaction="snake.html">Snake</button>
<button type="submit" formaction="sokoban.html">Sokoban</button>
<button type="submit" formaction="tetris.html">Tetris</button>
</form>
</div>
</div>
</body>
</html>

After that is required to regenerate file system data by calling script called: regen-fsdata.sh. I have modified also file webserver.c and removed unused CGI handles. For this example we need only initialization of tinyusb, lwip, dhcpd and httpd. At the end I have generated image in format uf2 and copied it to Raspberry Pi Pico. After reboot in system is present a ethernet interface. When we type in browser following address: http://192.168.7.1/ we can see a main page hosted on Pico. Below there is short video presentation:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • dubbie
    dubbie over 4 years ago +1
    Very good concept. If I had a Pi Pico I might try this myself. It might my understanding of the internet and stuff. Dubbie
  • kk99
    kk99 over 4 years ago in reply to dubbie +1
    Yes, I really like that in really quick way there is possibility to create a device with web interface e.g. managed switch for power supply etc.
  • kk99
    kk99 over 4 years ago in reply to dubbie

    Yes, I really like that in really quick way there is possibility to create a device with web interface e.g. managed switch for power supply etc.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 4 years ago

    Very good concept. If I had a Pi Pico I might try this myself. It might my understanding of the internet and stuff.

     

    Dubbie

    • 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 © 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