1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 20:49:49 +04:00
Files
unleashed-firmware/documentation/js/js_builtin.md
knrn64 54adc38b3a Documentation: new doc on Storage module and JS cleanup (#4161)
- Add new doc on Storage module
- Improve formatting in the JS section for better readability
2025-03-26 18:29:26 +04:00

827 B

Built-in methods

require()

Load a module plugin.

Parameters

  • Module name

Examples

let serial = require("serial"); // Load "serial" module

delay()

Parameters

  • Delay value in ms

Examples

delay(500); // Delay for 500ms

print()

Print a message on a screen console.

Parameters The following argument types are supported:

  • String
  • Number
  • Bool
  • undefined

Examples

print("string1", "string2", 123);

console.log()


console.warn()


console.error()


console.debug()

Same as print, but output to serial console only, with corresponding log level.


to_string()

Convert a number to string with an optional base.

Examples

to_string(123) // "123"
to_string(123, 16) // "0x7b"