Upgrade Nuget
大石头 authored at 2024-11-20 14:35:47
271.00 B
SmartA2
using NewLife.IoT.Controllers;

// USB口电源控制,可用于控制外部USB设备上电。如风扇、灯光、水泵等
var usb = new FileOutputPort("/dev/usbpwr");

// 上电
usb.Write(true);

Thread.Sleep(500);

// 断电
usb.Write(false);

Thread.Sleep(500);