A Kaluma library for Pimoroni's PicoSystem, pocket-sized handheld gaming console.
- BOOTSEL : Keep pressing Button X and turn on power.
- SKIP CODE LOADING : Keep pressing Left Button and turn on power. (Don't want to load JavaScript code stored in the flash)
Here is some code examples:
const {PicoSystem, Input} = require('picosystem');
const pico = new PicoSystem();
// Initialize
pico.init();
// Graphics
pico.gc.setFillColor(pico.gc.color16(255, 255, 255));
pico.gc.fillRect(0, 0, 240, 240);
pico.gc.display();
// Buttons
// - synchronous
let a = pico.input(Input.A);
console.log(a); // 1 = on, 0 = off
// - asynchronous
setWatch(() => {
console.log('A clicked');
}, Input.A, FALLING);
// Sound
pico.tone(400, 1000); // 400Hz 1sec
Tetris is provided as a sample game in game/tetris.js
.
kaluma flash ./game/tetris.js --bundle --port <port>
A class for PicoSystem.
Create an instance of PicoSystem class.
const {PicoSystem} = require('picosystem');
const pico = new PicoSystem();
pico.init();
// ...
<BufferedGraphicContext>
An instance ofBufferedGraphicContext
for the LCD display.
Initialize the PicoSystem.
pin
<number>
The pin number to read state.
Read the state of the input button.
onoff
<boolean>
Turn on or off the LCD's backlight.
freq
<number>
Frequency.duration
<number>
Time duration.
Generate sound on the PicoSystem's buzzer.
<number>
The pin number for Button A.
<number>
The pin number for Button B.
<number>
The pin number for Button X.
<number>
The pin number for Button Y.
<number>
The pin number for the joypad up.
<number>
The pin number for the joypad down.
<number>
The pin number for the joypad left.
<number>
The pin number for the joypad right.
<number>
The pin number for the PicoSystem' buzzer.