@@ -151,8 +151,11 @@ if __name__ == "__main__":
151151 # Notifyが来たら(ボタンが押されたら)、MyDelegate.notify_button()が実行され、終了する。
152152 while True :
153153 if toio.waitForNotifications(10.0 ):
154- # Notify処理が実行された時
154+ # Notify処理が実行された後の処理
155155 break
156+ elif
157+ # Notify処理がなく、10.0秒経った後の処理
158+ pass
156159
157160 # --- 切断
158161 toio.disconnect()
@@ -355,7 +358,7 @@ time.sleep(1)
355358| 書式| ** motorTarget(x, y, dir, timeout, mtype, speed_max, speed_type))** |
356359| 引数| ** X** : 目的のX座標|
357360|| ** Y** : 目的のY座標|
358- || dir: 目的地でのコアキューブの角度。` 省略可能 ` 。省略時は角度の修正は行わない。 [ 詳細] ( https://toio.github.io/toio-spec/docs/ble_motor#%E7%9B%AE%E6%A8%99%E5%9C%B0%E7%82%B9%E3%81%A7%E3%81%AE%E3%82%AD%E3%83%A5%E3%83%BC%E3%83%96%E3%81%AE%E8%A7%92%E5%BA%A6-%CE%B ) |
361+ || dir: 目的地でのコアキューブの角度。` 省略可能 ` 。省略時は角度の修正は行わない。 [ 詳細] ( https://toio.github.io/toio-spec/docs/ble_motor#%E7%9B%AE%E6%A8%99%E5%9C%B0%E7%82%B9%E3%81%A7%E3%81%AE%E3%82%AD%E3%83%A5%E3%83%BC%E3%83%96%E3%81%AE%E8%A7%92%E5%BA%A6-%CE%B8 ) |
359362|| timeout: タイムアウト時間(秒)。` 省略可能 ` 。省略時は10秒|
360363|| mtype: 移動タイプ。` 省略可能 ` 。省略時は0(回転しながら移動)。 [ 詳細] ( https://toio.github.io/toio-spec/docs/ble_motor#%E7%A7%BB%E5%8B%95%E3%82%BF%E3%82%A4%E3%83%97 ) |
361364|| speed_max: モーターの最大速度指示値。` 省略可能 ` 。省略時は 0x50|
@@ -542,7 +545,7 @@ time.sleep(0.5)
542545| :---| :--|
543546| 書式| ** soundSequence(times, operations)** |
544547| 引数| ** times** :<p >0: 無限に繰り返す<P >1~255: 繰り返し回数 |
545- || ** operations** : サウンドの再生パターンを配列で指定<p > [ [ duration, note] , [ duration, note] , ... ] のように指定する。|
548+ || ** operations** : サウンドの再生パターンを配列で指定<p > [ [ duration, note] , [ duration, note] , ... ] のように指定する。durationは0.01ms単位 |
546549| 戻り値| なし|
547550
548551#### 実行例
@@ -581,7 +584,7 @@ toio.soundStop()
581584#### 実行例
582585
583586```` py
584- toio.soundMono(0 , 60 ) # ド
587+ toio.soundMono(0 , 60 ) # ドを無限に鳴らす
585588time.sleep(2.0 )
586589toio.soundStop()
587590````
@@ -668,8 +671,11 @@ if __name__ == "__main__":
668671 # Notifyが来たら(ボタンが押されたら)、MyDelegate.notify_button()が実行され、終了する。
669672 while True :
670673 if toio.waitForNotifications(10.0 ):
671- # Notify処理が実行された時
674+ # Notify処理が実行された後の処理
672675 break
676+ elif
677+ # Notify処理がなく、10.0秒経った後の処理
678+ pass
673679
674680 # --- 切断
675681 toio.disconnect()
@@ -766,7 +772,7 @@ if __name__ == "__main__":
766772
767773<br >
768774
769- > ` notify_button(self, id, stat ): `
775+ > ` notify_button(self, id, status ): `
770776> | 項目| 型| 詳細|
771777> | :---| :--| :--|
772778> | ** id** | int| 0x02 固定|
@@ -829,7 +835,7 @@ if __name__ == "__main__":
829835> | 項目| 型| 詳細|
830836> | :---| :--| :--|
831837> | ** mode** | int| 通知内容の種類(0x01 オイラー角のみ)|
832- > | ** interval** | int| Notifyを返す間隔(10ms単位)|
838+ > | ** interval** | int| Notifyを返す間隔(10ms単位) 0x00 を指定すると無効化する |
833839>
834840> 本来、オイラー角の他、クォータニオンでの通知が可能だが、複雑になるので、オイラー角のみ有効にしている
835841
@@ -861,10 +867,10 @@ if __name__ == "__main__":
861867 # Notifyが来たら(ボタンが押されたら)、MyDelegate.notify_button()が実行され、終了する。
862868 while True :
863869 if toio.waitForNotifications(10.0 ):
864- # Notify処理が実行された時
870+ # Notify処理が実行された後の処理
865871 break
866872 elif
867- # Notify処理がなく、10.0秒経った時
873+ # Notify処理がなく、10.0秒経った後の処理
868874 pass
869875
870876 # --- 切断
0 commit comments