@canuxs/teaajs
v1.0.0
Published
A micro:bit inspired CLI tool to build custom JS consoles and interfaces.
Readme
TeaaJS
TeaaJS is a CLI engine for building virtual 7x7 RGB LED matrix consoles.
INSTALLATION
npm install -g teaajs
QUICK START
- Create a project: teaajs new as mygame
- Generate the UI: teaajs start mygame.tjs
- Open the output: Launch mygame.html in your browser.
COMMANDS
- NEW: teaajs new as {name}
- EDIT: teaajs edit {file} {path}
- EXPORT: teaajs export {file} to {path}
- START: teaajs start {file}
API REFERENCE
Functions:
- setLED(index, r, g, b): Sets color (index 0-48).
- setBrightness(val): Sets intensity (0-255).
- clear(): Turns off all LEDs.
Events:
- function onInput(key): Triggers on button press.
- Keys: W, A, S, D, P0, P1, P2, TRIANGLE, SQUARE, CIRCLE, X.
EXAMPLE CODE
setBrightness(255); setLED(24, 255, 0, 0);
function onInput(key) { if(key === 'X') clear(); }
