See Documentation
- Supports all features of Boltiot API Free and Pro plans
This is a regular plugin for Godot.
Copy the contents of addons/boltiot-api
into the addons/
folder in the same directory as your project, and activate it in your project settings.
Note: You will need a valid API key from Boltiot Cloud API
-
After activating the plugin. There will be a new
Boltiot
node added to Godot. Click on any node in the scene tree for exampleRoot
and add theBoltiot
node as a child. -
Attach a script to the
Root
node.
extends Node2D
func _ready():
var bolt = $Boltiot
# Make sure to keep your API key secret
bolt.setup("<YOUR_API_KEY>", "<YOUR_DEVICE_ID>")
# Now you can run any of the Bolt API commands
# Make sure to use yield() on every command
var response = yield(bolt.digital_read(1), "completed")
print(response)
For queries/suggestions/bugs join Discord server: 3ddelano Cafe
This project is not affiated with Boltiot Cloud or Inventrom Private Limited.
Inherits: HTTPRequest
The main Node which interacts with the Boltiot Cloud API
All method other than Boltiot.setup()
return a Dictionary
with the following keys:
{
"success": bool,
...additional keys like value, data
}
Method other than Boltiot.setup()
are async which means you should use yield(method, "completed")
in order to get the result.
Methods (Refer to Boltiot API Docs for more details)
Returns | Definition | Is Async |
---|---|---|
GPIO Methods | ||
void | setup(api_key: String, device_id: String) | No |
Dictionary | digital_write(pin: int, state: bool) | Yes |
Dictionary | digital_multi_write(pins: Array[int], states: Array[bool]) | Yes |
Dictionary | digital_read(pin: int) | Yes |
Dictionary | digital_multi_read(pins: Array[int]) | Yes |
Dictionary | analog_write(pin: int, state: bool) | Yes |
Dictionary | analog_multi_write(pins: Array[int], states: Array[int]) | Yes |
Dictionary | analog_read(pin: String = "A0") | Yes |
UART Methods | ||
Dictionary | serial_begin(baud: int = 9600) | Yes |
Dictionary | serial_write(data: String) | Yes |
Dictionary | serial_read(till?: int) | Yes |
Dictionary | serial_write_read(data: String, till?: int) | Yes |
Dictionary | serial_read(till?: int) | Yes |
Dictionary | serial_read(till?: int) | Yes |
Utility Methods | ||
Dictionary | get_version() | Yes |
Dictionary | get_device_status() | Yes |
Dictionary | get_devices() | Yes |
Dictionary | restart() | Yes |
Pro Methods | ||
Dictionary | servo_write(pin: int, state: bool) | Yes |
Dictionary | servo_multi_write(pins: Array[int], states: Array[bool]) | Yes |
Dictionary | fetch_data() | Yes |