From 48ef68dd866b9f9d5b18ae5e9b6772cbcc6441b3 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Mon, 17 Apr 2023 01:20:36 +0200 Subject: [PATCH] examples: replace fmt with encoding/hex in usb-midi example Signed-off-by: deadprogram --- src/examples/usb-midi/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/examples/usb-midi/main.go b/src/examples/usb-midi/main.go index e7ced2c6..c9b71313 100644 --- a/src/examples/usb-midi/main.go +++ b/src/examples/usb-midi/main.go @@ -1,9 +1,10 @@ package main import ( - "fmt" "machine" "machine/usb/midi" + + "encoding/hex" "time" ) @@ -20,7 +21,7 @@ func main() { m := midi.Port() m.SetHandler(func(b []byte) { led.Set(!led.Get()) - fmt.Printf("% X\r\n", b) + println(hex.EncodeToString(b)) m.Write(b) })