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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.