-
Is it compulsory to turn on the Pico each time to use it? How did you do it?
No, you don’t have to turn it on. You plug it into the USB, and start pressing buttons. -
What language are you using? I have the impression that it’s MicroPython.
It’s either python or micropython. Sorry I cannot help you more than that. I know just the basics. But it’s a very basic project. -
Is there anything to implement in defold to make the controller playable.
No. If you use my code, it’s the same as pressing a key on a USB keyboard. It works on anything you can plug a USB keyboard into (I would guess…). -
Is it possible to send messages to the Pico from Defold and how? To change the leds for example.
You have two options for the LEDs:
-
You can get 5v from Pin40 (labelled VBUS) of the pico [assuming your USB connection provides 5v]. That means the LEDs will turn on as soon as the pico is plugged in, and stay turned on.
-
You can get messages from the buttons themselves to the pico (but you can’t send messages from defold to the Pico). So, you could program the pico so that LEDs turn on and off according to button presses (if your LEDs work with 3.3v, which is what the pico outputs from GP). It would involve putting these lines of code in somewhere:
from machine import Pin -- this fetches the library.
pin_led = Pin(26, mode=Pin.OUT) -- defines GP26 as controlling an LED
pin_led.on() -- sends 3.3v to GP26
pin_led.off() -- sends 0v to GP26
Read more about controlling LEDs with a pico here.