Skip to content

Mikro.jsexperimental

TypeScript for microcontrollers

Modern JavaScript, type safety and fast refresh on real hardware.

Mikro.js logo

Your first program ​

Blinky: the "Hello, World!" of tiny devices.

ts
import {
DigitalOut
} from 'mikro/gpio'
import {
sleep
} from 'mikro/sleep'
// Replace with your board's LED GPIO pin if different const
led
=
DigitalOut
(15).
orPanic
('Failed to configure LED pin')
while (true) {
led
.
write
(1)
await
sleep
(500)
led
.
write
(0)
await
sleep
(500)
}

Get it running:

sh
npm create mikro -- --template blinky
sh
pnpm create mikro --template blinky
sh
yarn create mikro --template blinky
sh
bun create mikro --template blinky

Learn more ​

Mikro.js is built with AI assistance, code and docs alike. Read the AI disclosure.