swatch.vibrator([OnTime[,OffTime[,Repeat]]])
SmartWatchのバイブレータを振動させます。引数省略時は、0.5sec間、一度だけ振動します。OnTimeのみ指定した場合は、指定時間、一度だけ振動します。
引数
- OnTime: 振動時間。msで指定します。
- OffTime: 振動停止時間。msで指定します。
- Repeat: 繰り返し回数。
(注意) swatchコマンドを使うには、別アプリのBitmapキャッチャが必要です。
Bitmapキャッチャのダウンロードはこちらから
→ https://play.google.com/store/apps/details?id=com.luaridaworks.smartwatch.bitmapcatcher
使用例
--SmartWatchアプリBitmapキャッチャを起動させる swatch.start() while(true)do local x,y,s,d = swatch.touch() if( d==0 or d==1 or d==2 or d==3 )then --スィープ入力があった swatch.vibrator(100, 200, 3) --100ms振動、200ms停止を3回繰り返す break end end --SmartWatchアプリBitmapキャッチャを終了させる swatch.stop() system.exit()