A complete guide to coding, testing, and flashing your games.
It has four layers working together:
The first layer is a C-based hardware abstraction layer that handles everything at the chip level — initializing the OLED display over I2C, driving audio through PWM, and reading button states from GPIO pins.
Above that is a PIO assembly driver that uses the RP2040's Programmable I/O state machines to handle display refresh independently, so the game logic never gets blocked waiting for the screen to update.
The third layer is a lightweight JavaScript interpreter optimized specifically for 264KB of RAM. A standard JS engine is too heavy for this hardware, so our runtime strips everything down to only what the game loop needs — no unnecessary overhead, boots in under 2 seconds, runs at a stable 30fps.
And the top layer is the bit.* API — our student-facing game engine interface. Eleven drawing commands, button input handlers, square wave audio, and a 30fps game loop. That is what students write their games against.
So in short, the GyanBit Runtime is a purpose-built, four-layer game engine — hardware driver at the bottom, PIO display system above that, JS interpreter in the middle, and a clean game API on top. Every layer was designed around this specific hardware to get maximum performance at minimum cost.
Get started making your very first game with the GyanBit game engine, using JavaScript! GyanBit is a great tool for both beginners and advanced programmers, and if you make a game, you can play it on your own DIY handheld console! Follow this four-part series in order, and you'll get to make your very own puzzle game.
Getting familiar with the GyanBit Engine + Make your first puzzle!
Maze Game (Part 1/3): Characters, Enemies and Maps.
Maze Game (Part 2/3): Adding Gameplay Mechanics
Maze Game (Part 3/3): Polish & Flash to Hardware
GyanBit games run inside a loop. The screen is 128 pixels wide and 64 pixels tall. The top-left corner is X: 0, Y: 0.
// 1. Tell GyanBit to loop this code 30 times a second bit.loop(() => { // 2. Clear the screen every frame so it doesn't smear bit.clear(); // 3. Draw a filled box at X=60, Y=30, Width=8, Height=8 bit.fill(60, 30, 8, 8); // 4. Draw some text at the top left bit.text(2, 2, "HELLO WORLD!"); });
Let's use the D-Pad buttons (UP, DOWN, LEFT, RIGHT) to move our box!
// Create variables outside the loop to remember the position let playerX = 60; let playerY = 30; bit.loop(() => { bit.clear(); // Check if a button is currently pressed down if (bit.isHeld('right')) { playerX += 2; } if (bit.isHeld('left')) { playerX -= 2; } if (bit.isHeld('up')) { playerY -= 2; } if (bit.isHeld('down')) { playerY += 2; } // Draw the player using the updated coordinates bit.fill(playerX, playerY, 8, 8); });
Your AI coding buddy that lives on every page! Click the 🤖 button in the bottom-right corner to start chatting.
BYTE is an AI assistant that knows everything about GyanBit — the bit.* API, hardware specs, game tutorials, and more. It's like having a coding tutor available 24/7!
Just click the 🤖 button and type your question! Try these:
BYTE only knows about GyanBit and coding. It can't browse the internet, access your files, or see your personal information. Your chat stays on your device. BYTE is powered by Google's Gemini AI with strict safety filters enabled.
Visual breakdowns of how GyanBit works — from code to console.
Everything you need to know about learning, building, and playing with GyanBit.
The brain of GyanBit — a powerful dual-core ARM Cortex-M0+ microcontroller.
SH1106 monochrome 128×64 display — crisp whites on deep blacks.
Tactile membrane buttons: D-Pad, A, B, and START for full game control.
Sustainable bamboo-fiber enclosure. 100% biodegradable at end of life.
Go to the GyanBit website and click "Open Studio". The browser-based IDE will load instantly — no downloads needed.
Use the bit.* API to write game logic in JavaScript. Try loading a sample game from the Gallery to see how it works!
Click ▶ RUN to instantly preview your game on the built-in OLED simulator. Use the on-screen D-Pad to play!
Connect your GyanBit via USB-C, click ⚡ FLASH. The code auto-translates to MicroPython and runs on the real console!
| Function | Description |
|---|---|
bit.clear() |
Clears the entire 128×64 screen |
bit.fill(x,y,w,h) |
Draws a filled rectangle |
bit.text(x,y,str) |
Renders pixel text at the given position |
bit.line(x1,y1,x2,y2) |
Draws a line between two points |
bit.circle(cx,cy,r) |
Draws an outline circle |
bit.isHeld('btn') |
Returns true if button is held down (up/down/left/right/a/b) |
bit.isPressed('btn') |
Returns true only on the frame the button was first pressed |
bit.loop(fn) |
Registers the main game loop (runs at ~30fps) |
bit.beep(freq,ms) |
Plays a square-wave beep at the given frequency |
Contains a rechargeable LiPo cell. Charge via USB-C with any standard 5V adapter. Avoid overcharging.
Wipe the bamboo shell with a dry or slightly damp cloth. Avoid harsh chemicals near the OLED screen.
The bamboo shell is 100% biodegradable. End-of-life PCBs should be recycled at designated e-waste facilities.