PC & Laptop
A PC or Laptop running Windows, Linux, or Mac can finally have easy access to hundreds of sensors and actuators. There are many Coding Language options to cover every need.
Our demo is built using JavaScript and offers an excellent starting point to play with DUELink modules and see how the web can be used to access sensors and actuators.
Artificial Intelligence (AI) applications that use Python can take advantage the entire DUELink ecosystem. This demo uses facial detection to move a servo (to open a door!)
This demo uses a USB Hook with Servo X1 module, but any other modules, or multiple modules, can be used as well.
- Python
- JavaScript
from DUELink.DUELinkController import DUELinkController
availablePort = DUELinkController.GetConnectionPort()
print("Using port: ", availablePort)
duelink = DUELinkController(availablePort)
# Servo on pin 1 to 90 degrees
duelink.Servo.Set(1, 90)
const { SerialUSB } = require("dlserialusb");
const { DUELinkController } = require("duelink");
async function MoveServo() {
let duelink = new DUELinkController(new SerialUSB());
await duelink.Connect();
// Servo on pin 1 to 90 degrees
await duelink.Servo.Set(1, 90)
}
await MoveServo();
Wireless interfaces, such as Bluetooth, can also be used instead of USB. In fact, the PC libraries do not care what medium is being used. It sees a virtual serial port in any of these cases. Wireless Hook is an excellent module for this use.