これは開発版のドキュメントである. 内容は次のリリースまでに変更される可能性がある. 最新のリリース版は 0.14.x を参照.
SetGpioOut
SetGpioOut は, デバイスの 4 本の GPIO 出力端子に出力する信号を設定するコマンド.
SetGpioOut { outputs };SetGpioOut(outputs=outputs)new SetGpioOut(outputs);| フィールド | 型 | デフォルト | 説明 |
|---|---|---|---|
outputs |
[GpioOut; 4] |
すべて Off |
端子 0..3 に割り当てる出力 |
GpioOut
Section titled “GpioOut”Off |
常に Low (デフォルト) |
BaseSignal |
超音波の基準信号 (40 kHz) |
Thermo |
温度センサのアサート |
ForceFan |
ForceFan の状態 |
Sync |
同期信号 |
ModBank |
アクティブな Modulation バンク |
ModIdx(u16) |
Modulation が指定インデックスのとき High |
PatternBank |
アクティブな Pattern バンク |
PatternIdx(u16) |
Pattern が指定インデックスのとき High |
IsStmMode |
Stm モード (size != 1) のとき High |
SysTimeEq(SysTime) |
システム時刻が指定値に一致したとき High |
SyncDiff |
同期誤差 |
PwmOut(u8) |
指定振動子の PWM 出力 |
Direct(bool) |
指定した固定値を直接出力 |
SysTimeEq に渡す SysTime については, SysTime を参照.
Example
Section titled “Example”use autd3_rs::commands::{Clear, GpioOut, SetGpioOut, Synchronize};use autd3_rs::geometry::{Autd3, Geometry};use autd3_rs::Client;use autd3_rs::udp::TransportOption;
let geometry = Geometry::new(vec![Autd3::default()]);let option = TransportOption::default();let mut client = Client::open(&geometry, &option).await?;client.send(Clear).await?;client.send(Synchronize).await?;
client.send(SetGpioOut { outputs: [ GpioOut::PatternBank, GpioOut::Thermo, GpioOut::PwmOut(0), GpioOut::Off, ],}).await?;import asyncio
from autd3 import Client, TransportOptionfrom autd3.commands import Clear, GpioOut, SetGpioOut, Synchronizefrom autd3.geometry import Autd3, Geometry
async def main() -> None: geometry = Geometry([Autd3()]) with await Client.open(geometry, TransportOption()) as client: await client.send(Clear()) await client.send(Synchronize())
await client.send( SetGpioOut( outputs=[ GpioOut.PatternBank, GpioOut.Thermo, GpioOut.PwmOut(0), GpioOut.Off, ] ) )
asyncio.run(main())using System.Threading.Tasks;using AUTD3;
var geometry = new Geometry(new[] { new Autd3() });using var client = await Client.OpenAsync(geometry, new TransportOption());await client.SendAsync(new Clear());await client.SendAsync(new Synchronize());
await client.SendAsync(new SetGpioOut(new[]{ GpioOut.PatternBank, GpioOut.Thermo, GpioOut.PwmOut(0), GpioOut.Off,}));