micro:bit Numeric
通信 | 62.7KB
このアプリは、AndroidとMicro:ビットデバイスの間で通信します。数値データをテキストまたは値として送信できます。 UART通信もマイクロ:ビットデバイスで実装されなければなりません。
テキスト有効:テキストデータ送信
テキスト無効:数値データ送信:Newline Enabled: ' n'(Newline)追加されました
NewLine Disabled:追加データなし
ゼロ有効(タッチ/センス有効):リリースボタンで0を送信する
PXTプログラミングの場合は、テキストと改行を有効にする必要があります。
要件:
- 最小。 Android 4.4
-
Bluetooth Low Energy(BLE)
- ペアデバイス!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
PXT JavaScriptの例:
let str = ""
接続されている= 0
input.onButthonPressed(button.a、()=> {
{
}
}
})
Bluetooth.onbluetoothConnected(()=> {{
{{
)
bluetooth.onbluetoothDiscenced(()=> {{
{
{
} connected = 0
})
Bluetooth.StartuartService ()
basic.forever(()=> {{
{
str = bluetooth.uartreaduntil(serial.delimiters(delimiters.newline))
if(str = = "b"){
basic.showstring( "hi")} else {
basic.showstring(str)
}
{
basic.showleds( `
。。。。
#。#。
。。。。。。#。。。#。。#
#。#。#。
}}
})
備考:デバイスをペアリングするのを忘れないでください(マイクロ:ビットプログラムの変更後)
bug receiving solved