Welcome to Kameleon! To get started with Kameleon, we strongly recommend you to code online with Kameleon IDE If you have reliable internet connection. Otherwise, you can also have alternative to code in local with CLI (Command Line Interface).
To code online with Kameleon IDE ensure that you are signed up in the web (https://kameleon.io).
To code online you have to install Kameleon Agent first.
Open the Playground and write your code.
var led = board.LED0;setInterval(function () {led.toggle();}, 1000);
Connect the board to your computer using a USB cable. You can find connected Kameleon boards in Playground.
Press upload button in Playground
You can also code with your familiar editors (e.g. Visual Studio Code, Atom, Sublime Text, etc.) and then upload the code with Kameleon CLI.
Open a terminal and install Kameleon CLI. (Ensure that Node.js/NPM is already installed. Sometimes you may need to use npm option --unsafe-perm=true
)
$ (sudo) npm install -g kameleon-cli
Write your code with your familiar code editor.
index.jsvar led = board.LED0;setInterval(function () {led.toggle();}, 1000);
Connect the board to your computer using a USB cable and then check serial port where the board is connect.
$ kameleon -l # 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 to the board using CLI.
$ kameleon write index.js -p <port> . # COM?, /dev/tty.usbmodem?, ttyACM?