Totem Library
New version is available to install in Arduino IDE.
Single “Totem Library” now became a pack multiple headers for remote control of Totem products.
Use of #include <Totem.h>
is deprecated and will be removed.
Check new code examples in File
→ Examples
→ Totem Library
.
All library features can be found in documentation site:
https://docs.totemmaker.net/modules/
// Control over BLE
#include <TotemBLE.h> // Discover Totem boards (scan)
#include <TotemMiniControlBoard.h> // Connect Mini Control Board
#include <TotemRoboBoardX3.h> // Connect RoboBoard X3
#include <TotemRoboBoardX4.h> // Connect RoboBoard X4
// Control over Serial
#include <TotemLabBoard.h> // Interface Mini Lab
Remote board control
Remotely control Totem boards from external ESP32 board.
Simply include header file to establish connection and send commands.
More information and API reference: https://docs.totemmaker.net/modules/ble/
#include <TotemMiniControlBoard.h>
TotemMiniControlBoard board;
void setup() {
board.connect(); // Find and connect over Bluetooth
}
#include <TotemRoboBoardX3.h>
TotemRoboBoardX3 board;
void setup() {
board.connect(); // Find and connect over Bluetooth
}
#include <TotemRoboBoardX4.h>
TotemRoboBoardX4 board;
void setup() {
board.connect(); // Find and connect over Bluetooth
board.rgbColor(0, 128, 0); // Set RGB to green
board.servoSpinA(50); // Spin Servo motor A
}
User defined controls
Library allows to exchange user defined data with RoboBoard.
See documentation for more options: https://docs.totemmaker.net/roboboard/api/totemapp/#totem-library
Totem Library:
#include <TotemRoboBoardX4.h>
TotemRoboBoardX4 board;
void setup() {
board.connect(); // Find and connect over Bluetooth
board.sendValue(1, 100); // Send to X4
board.sendString(2, "Hello"); // Send to X4
}
RoboBoard X4:
// Intercept value sent by sendValue() (from Totem Library)
void onReceiveValue(int id, int value) {
}
// Intercept string sent by sendString() (from Totem Library)
void onReceiveString(int id, String string) {
}
void setup() {
// Start Totem App service
TotemApp.begin();
// Register receive value handlers
TotemApp.addOnSend(onReceiveValue);
TotemApp.addOnSend(onReceiveString);
}
Mini Lab
Same code interface is followed trough LabBoard control over Serial
#include <TotemLabBoard.h>
TotemLabBoard board;
void setup() {
board.led.on();
}