https://daeudaeu.com/c-http-server/
-------------------------------------------------------------------------------
dcm-driver-boad::
input.onButtonPressed(Button.A , function () {
radio.sendString("f")
basic.showLeds(`
. . # . .
. # # # .
# . # . #
. . # . .
. . # . .
`)
})
input.onButtonPressed(Button.A B, function () {
radio.sendString("s")
basic.showIcon(IconNames.D iamond)
})
radio.onReceivedString(functio n (receivedString) {
basic.showString( receivedString)
if (receivedString == "f") {
basic.showLeds(`
. . # . .
. # # # .
# . # . #
. . # . .
. . # . .
`)
pins.analogWritePin(An alogPin.P1, 602)
pins.digitalWritePin(D igitalPin.P13, 1)
pins.digitalWritePin(D igitalPin.P12, 0)
}
if (receivedString == "b") {
basic.showLeds(`
. . # . .
. . # . .
# . # . #
. # # # .
. . # . .
`)
pins.analogWritePin(An alogPin.P1, 543)
pins.digitalWritePin(D igitalPin.P13, 0)
pins.digitalWritePin(D igitalPin.P12, 1)
}
if (receivedString == "s") {
basic.showIcon(IconNam es.Diamond)
pins.analogWritePin(An alogPin.P1, 576)
pins.digitalWritePin(D igitalPin.P13, 1)
pins.digitalWritePin(D igitalPin.P12, 1)
}
})
input.onButtonPressed(Button.B , function () {
radio.sendString("b")
basic.showLeds(`
. . # . .
. . # . .
# . # . #
. # # # .
. . # . .
`)
})
radio.setGroup(132)
basic.showIcon(IconNames.Heart )
pins.digitalWritePin(DigitalPi n.P14, 1)
basic.forever(function () {
})
0 件のコメント:
コメントを投稿