Getting Started

Welcome to Kaluma! Kaluma is a tiny JavaScript platform for microcontrollers. If you are a JavaScript developer familiar with Node.js, you can make DIY electronics without learning a new language like C/C++ or Arduino sketch. In this article we will give you a quick tutorial to get start JavaScript programming with Raspberry Pi Pico.

Upload firmware (.UF2)

You can upload Kaluma firmware to your Raspberry Pi Pico board by following steps.

  1. Download Kaluma firmware .UF2 file from https://kaluma.io/download.

  2. Push and hold the BOOTSEL button and plug into USB port of your computer. Release the BOOTSEL button after connected. It will mount as as USB storage device named RPI-RP2.

  3. Drag and drop the downloaded .UF2 onto the RPI-RP2 volume. Your Pico will reboot automatically.

  4. Now Kaluma is running on your Pico.

Plug Pico into USB for firmware upload

From now on, we will explain how to write code using the Kaluma IDE. It provides various features including syntax checking, automatic code bundling, integrated terminal, etc. Nevertheless you want to write your code using text editor (e.g. VSCode, Sublime Text, Atom, Vim, etc.), you can use CLI.

Install Kaluma Agent

Before writing your code we need to install Kaluma Agent by downloading from https://kaluma.io/agent. Kaluma Agent is a background service to communicate Web-based IDE and the board connected on a USB port of your computer. After installation, you can find an icon in the tray. You need to ensure that the agent service is started.

Kaluma Agent in Tray

Open IDE

Now you are ready to code with Kaluma. Open IDE by visiting at https://kaluma.io/ide or clicking the IDE menu in the website. Then, select the Raspberry Pi board in the device select dropdown box in the top-right area in the IDE.

Select the board in IDE

The IDE will try to communicate with the connected board and will show the welcome message received from the board in the Terminal area. In the terminal, you can use it as a JavaScript REPL (Read-Eval-Print Loop) mode. So you will get the result 3 when you enter 1+2.

Terminal connected to the board

Upload your code

We will write a code for blinking LED on the Raspberry Pi Pico board for every seconds. Enter the below code in the Editor area of IDE.

var led = 25; // LED of Raspberry Pi Pico
pinMode(led, OUTPUT);
setInterval(() => {
digitalToggle(led);
}, 1000);

To upload the code, click the “Upload” button. After a moment, you will see the blinking LED in the board.

Blinking LED

Congratulation, now you have completed basic steps to use Kaluma. Please note that the code in IDE is not be saved. If you want to save the code, you can save the code as a project by selecting Save menu or press Ctrl+S shortcut.