Brainstation
A small video game console for Arduino using the Brainduino interpreter
Install / Use
/learn @brain-labs/BrainstationREADME
BrainStation
Perhaps the smallest full-working video game console for Arduino based on the NES Emulator
jamulator. It is also a proof of concept for the Brainduino interpreter
<img src="./img/table_of_contents.png" alt="table of contents">
Proof of Concept
<p align="center"> <img alt="HumanWalking" src="./img/human_walking.gif" /> </p>-
Human Jump // Avoiding obstacles controlling the character through Bluetooth
-
Game:
- Code:
setup
>>>>>>>?:++; we will only have two sprites at cell 7
build values for distant cells for later jump
>?<<<<<:++++++++>+*>+*>+++++++*<--*<---*<<<<<<;
?->>>>>>^>>>+<<<<^:<<; if btn DOWN add Y of human object
?->>>>>>>>^>>>-<<<<^; if btn UP subtract Y of human object
player
>>>>>>>>^?:++; make number two if cell 41 is empty
<<?:++++++;>> go to cell 38 and make it 6 if empty
>+% add 1 to cell 42 and take it mod 2 because of the sprite number
<<?:+;^ go back to cell 1
monster 1
>>>>>>>>>^?:++; go to cell 48 and make number two if cell 48 is empty
>+%++ add 1 to cell 49 and take it mod 2 and add 2 because of monster sprite
>?--:++>_%<++++++++++++; if cell 16 is equal to 0 then we reset it to 15
?: if cell 50 is equal to zero
> go to cell 51
? check if it is different from zero
<<<<<<<< go to cell 43
?<<<<<^?:+;; if cell 43 different from zero then game over
: if cell 51 equal to zero
<<<<<<<< go to cell 43
?:<<<<<^?:+;; if cell equal to zero then game over
;
;
Status
In development mode, please check the dev branch
| To Do | In Progress | Done |
| :---: | :---------: | :---: |
||
|
|
|||
|
|||
|
Installation
You can follow the instructions given here: https://github.com/brain-labs/brainduino
How it works
BrainStation is based on old video game consoles such as NES and SNES and has its own PPU (Picture Processing Unit). That being said, the Arduino will follow some steps:
- Check for external user input and set the
cells 0 trough 5, if they are active. - Run the Brainduino as the CPU cycle (setting the values of the fields).
- Run the BrainStation as the PPU cycle (drawing the elements on the LCD).
The BrainStation uses the Brainduino cells (100 cells because of the Arduino limitation) as its Turing Tape and has this format:
Control Cells
| LEFT BTN | UP BTN | RIGHT BTN | DOWN BTN | A BTN | B BTN | IsGameOver | N Sprites | | :----------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :--------: | | Cell 0 | Cell 1 | Cell 2 | Cell 3 | Cell 4 | Cell 5 | Cell 6 | Cell 7 |
Cell 0: Left ButtonCell 1: Up ButtonCell 2: Right ButtonCell 3: Down ButtonCell 4: A ButtonCell 5: B ButtonCell 6: IsGameOver? (0: false, 1: true)Cell 7: NSprites (Number of objects shown at same time on LCD)
Custom Cells
| Custom | Custom | Custom | Custom | Custom | Custom | Custom | Custom | Custom | Custom | | :------: | :------: | :------: | :------: | :------: | :------: | :------: | :---------: | :---------: | :--------: | | Cell 8 | Cell 9 | Cell 10 | ... | ... | ... | ... | Cell 33 | Cell 34 | Cell 35 |
Cells 8 through 35: Custom Cells (You can use them for any kind of operation)
Object 1 Cells
| Custom Obj1 | Custom Obj1 | Custom Obj1 | Custom Obj1 | Custom Obj1 | Obj1 #Sprite | Obj1 #X Pos | Obj1 #Y Pos | | :---------: | :---------: | :---------: | :---------: | :---------: | :----------: | :---------: | :--------: | | Cell 36 | Cell 37 | Cell 38 | Cell 39 | Cell 40 | Cell 41 | Cell 42 | Cell 43 |
Cells 36 through 40: Custom Operations for the first objectCell 41: The sprite number of the object 1 at a given point (values are 0 through 7 because of the LCD limitation)Cell 42: X Position of object 1Cell 43: Y Position of object 1
Object 2 Cells
| Custom Obj2 | Custom Obj2 | Custom Obj2 | Custom Obj2 | Custom Obj2 | Obj2 #Sprite | Obj2 #X Pos | Obj2 #Y Pos | | :---------: | :---------: | :---------: | :---------: | :---------: | :----------: | :---------: | :--------: | | Cell 44 | Cell 45 | Cell 46 | Cell 47 | Cell 48 | Cell 49 | Cell 50 | Cell 51 |
Cells 44 through 48: Custom Operations for the second objectCell 49: The sprite number of the object 2 at a given point (values are 0 through 7 because of the LCD limitation)Cell 50: X Position of object 2Cell 51: Y Position of object 2
Obs.: From the Cell 36 on, every 8 cells represent a new object. Obs.2: The BrainStation has a maximum of 7 objects because of the Arduino and LCD limitations.
<p align="center"> <img alt="BrainStation" src="./img/brainstation.jpg" height="700px" /> </p>Help
Feel free to send your pull requests. :)
LICENSE
This project extends GNU GPL v. 3, so be aware of that, regarding copying, modifying and (re)destributing.
Related Skills
qqbot-channel
343.3kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
99.7k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
343.3kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
project-overview
FlightPHP Skeleton Project Instructions This document provides guidelines and best practices for structuring and developing a project using the FlightPHP framework. Instructions for AI Coding A

