Browse Source

examples/usb-midi: remove serial communication from MIDI example

Signed-off-by: deadprogram <ron@hybridgroup.com>
pull/3678/head
deadprogram 2 years ago
committed by Ron Evans
parent
commit
1a67795fd3
  1. 6
      src/examples/usb-midi/main.go

6
src/examples/usb-midi/main.go

@ -2,9 +2,8 @@ package main
import (
"machine"
"machine/usb/midi"
"machine/usb/adc/midi"
"encoding/hex"
"time"
)
@ -16,12 +15,11 @@ func main() {
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
button := machine.BUTTON
button.Configure(machine.PinConfig{Mode: machine.PinInputPullup})
button.Configure(machine.PinConfig{Mode: machine.PinInputPulldown})
m := midi.Port()
m.SetHandler(func(b []byte) {
led.Set(!led.Get())
println(hex.EncodeToString(b))
m.Write(b)
})

Loading…
Cancel
Save