Appendix B. Common Espruino Commands and Variables

What follows is a quick rundown of the most common Espruino commands. For a full list, check out the Espruino reference page.

Note

Where parameters are surrounded by [ and ], they’re optional and can be left out.

print(text) or console.log(text)

This prints the given text or variable to the console. console.log is the standard JavaScript way of printing, and print is provided for convenience. Both commands are identical.

For example, a="Hello World";print(a) will write Hello World to the console, as would print("Hello World").

You can also supply multiple arguments that will all be printed, separated by spaces.

LED1 and LED2

These variables are the pins that are connected to the onboard ...

Get Making Things Smart now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.