CLI (Command Line Interface)

You can also code with your familiar editors (e.g. Visual Studio Code, Atom, Sublime Text, etc.) and then upload the code with Kaluma CLI.

You can only upload only a single .js file with CLI. If you want to upload multiple .js files, you need to bundle them into a single .js file using Webpack or other bundlers.

Install Kaluma CLI

Open a terminal and install Kaluma CLI. Before installing CLI, please ensure that Node.js/NPM is already installed. Sometimes you may need to use sudo. If you are using Apple M1 Mac or Raspberry Pi OS, you need to install with --unsafe-perm and --build-from-source options.

$ npm install -g @kaluma/cli
# for Apple M1 or Raspberry Pi
$ sudo npm install -g @kaluma/cli --unsafe-perm --build-from-source

Write you code

Write your code with your familiar code editor.

index.js
var led = 25; // LED is GP25
pinMode(led, OUTPUT);
setInterval(function () {
digitalToggle(led);
}, 1000);

Plug the board

Plug the board into USB port of your computer and then check serial port where the board is connect.

$ kaluma list # list available serial ports
# e.g.) COM? (for Windows)
# e.g.) /dev/tty.usbmodem? (for MacOS)
# e.g.) /dev/ttyACM? (for Linux)

Upload your code

Upload your code to the board using CLI.

$ kaluma write index.js -p <port>