Last June, I introduced you to XOD, a new Open Source project for Arduino programming without Scratch’s cousin block assembly programming. In a few months, the project has evolved. Version 0.16 has just been published. I took the opportunity to install it and go around the owner. Many of you want to get started in Arduino projects without having any notion of programming. The XOD project is a very good starting point. It will allow you to build algorithms and see the result on concrete cases. Only downside, it should not be that English is rejecting you … but in IT, it’s difficult to move on!
Install XOD on Windows, macOS or Linux
The installer for Windows, macOS or Linux (deb or rpm) can be downloaded here. The website automatically detects your platform and offers the latest version available. The XOD Code Editor installs like any other application on your computer. On macOS, just open the dmg archive and drag the XOD icon to the application folder.
Get XOD examples
The installer is delivered without any example. To save time in getting started with the software, you can get the examples directly on GitHub. Several are available on the project repository here. Just download GitHub repository locally. Click on Clone or Download then Download ZIP or from the Terminal or Command Prompt by running git clone https://github.com/xodio/xod.git (be careful, the git command must be installed before).
The examples are in the workspace folder:
- Blink, the classic for flashing an LED
- lcd-time, to display the time on a 2004 LCD
- traffic-light, a traffic light simulator
- two-button-switch, to understand the binary logic
- water-station, the example put forward for developers to manage the watering of a plant by measuring the humidity with an analog probe
Program online with XOD
Presentation of the programming interface
When you open, XOD asks you what workspace you want to work on. To open a previously downloaded example, click Switch workspace directory.
Browse and place on the workspace folder of the GitHub project and click on Choose Directory. In the list that appears, choose the water-station project for example.
XOD does not revolutionize the genre. We find a workspace with a magnetic grid on which we will place the function blocks. I advise you to activate the contextual help by going in the menu View then Toggle Helpbar (on the right of the screen). You can also display the debugger (at the bottom of the screen). To place a node, just drag it from the list or press the little plus (+).
Each node has inputs and outputs. By clicking on a node, one accesses the parameters of the block, for example:
- The port (the pin of the Arduino)
- Parameters specific to the block. for example
As each parameter has its own input on the node, one can dynamically assign the value for each parameter. For example, we can retrieve the value of a potentiometer to set a threshold of switching on / off an LED using a map-range node.
The nodes are organized into several families, here is a current overview
- xod / bits, nodes for manipulating digital data (bits)
- bdc-to-dec, bitwise-and, bitwise-not, bitwise-or, bitwise-xor, dec-bcd, shift-ledt, shift-right
- xod/core, the basic nodes
- absolute, add, any, acos, analog-input, and, atan, asin, boot, cast-boolean-to-number, buffer, cast-boolean-to-pulse, cast-boolean-to-string, cast-number-to-boolean, cast-number-to-string, ceil, clock, clip, concat, concat-3, concat-4, concat-5, console-log, concat-6, constant-number, constant-boolean, constrain, constant-string, continuously, continuously-pausable, cos, count, cube, debounce-boolean, defer-boolean, defer-number, defer-pulse, defer-string, delay, digital-input, digital-output, discretize-2, discretize-3, discretize-4, divide, duty-to-time, equal, fade, flip-flop, flip-n-times, floor, format-number, gate, gate-number, gate-boolean, gate-pulse, gate-string, greater, i2c-begin-transmission, i2c-end-transmission, i2c-read, i2c-request, i2c-request-bytes-6, i2c-send-byte, i2c-send-bytes-2, i2c-write, if-else, if-else-string, less, log-10, log-bx, log-e, map-clip-range, map-range, modulo, multiply, nand, nor, not, nth-number-2, nth-number-3, nth-number-4, or, pi, pow, pulse-on-change, pulse-on-false, pulse-on-true, pwm-output, round, saw-wave, saw-wave-map, select, sin, sine-wave, sine-wave-map, sqrt, square, square-wave, subtract, system-time, tan, time-to-duty, timer, to-percent, tri-wave, tri-wave-map, watch, word-to-number, xor
xod/common-hardware, drivers that support sensors (analog, i2c, accelerometer …) and actuators (servomotor)
adxl335-accelerometer, adxl335-convert, button, dht11-thermometer, dht2x-pack, dht2x-thermometer, dhtxx-read-raw, ds1307-rtc-write, ds1307-rtc-read, gp2y0a-linearize, gp2y0a02-range-meter, gp2y0a21-range-meter, gp2y0a41-range-meter, h-bridge-dc-motor, hc-sr04-ultrasonic-range, hc-sr04-ultrasonic-time, l3g4200-gyro, led, lis331dlh-accelerometer, lis331hh-accelerometer, l3gd20h-gyro, lis3dh-accelerometer, pot, servo, sd-log, st-imu-generic-sensor, st-imu-normalize-va, st-imu-normalize-acc, st-imu-round-sensitivity, text-lcd-16×2, text-lcd-16×2-i2c, thermometer-tmp36
- All hardware supported by XOD is listed here. Free to everyone to develop their own drivers then from the base nodes
xod/units, nodes for unit conversions
- deg-to-rad, m-to-cm, m-to-in, m-to-ft, c-to-f, m-to-mm, rad-to-deg
Of course, we can develop its own nodes (library) to reuse them in other projects.
There is no search box at the top of the list. To find a node, you will need to navigate through the lists 🙁 or open the search box, it is in the Edit -> Insert Node menu, a keyboard shortcut would be welcome to gain productivity, the search field is very good. done because it allows to consult the documentation before inserting the node on the workspace Once the node found, it is added by a double-click.
The block assembly programming concept is a very good learning tool for small projects. This is very often the case for connected objects projects. Having worked for several years with Labview National Instrument, we are very quickly limited by the concept as soon as the project exceeds a few screens. XOD (and scratch) are perfect to understand programming concepts or to quickly make models.
XOD is still a project in the making. It still lacks some essential features for the development of connected objects. For v0.2, I would like to see the support of WiFi, some OLED screens (SSD1306, Nokia 5110) and the management of HTTP requests to communicate with a home automation server or an online service (Thingspeak for example). One more little effort gentlemen developers: D. You are almost there!
- HC-SR04 (ultrasound) vs Sharp GP2Y0A02YK0F (IR) vs VL53L0X (Laser), which solution to choose for distance measurement with Arduino or Raspberry Pi
- Test and Calibrate Sharp GP2Y0A02YK0F Asian Clone proximity Sensor
- Test the IDE XOD, develop Arduino projects without programming by assembling blocks
- BH1750 (GY-302), measure the lighting quality of your home (Arduino / ESP8266 / ESP32)
- Calculate the Air Quality Index (IAQ, IQA) with a DSM501 on Arduino or ESP8266
- Install the Arduino IDE (1.8 or higher) on Linux (Ubuntu 16.04 or later)