Serial is API what allow you to write to the UART. This API is currently obsolete and it was replaced with BufferedSerial. So if you want to use Serial you need MbedOS 5.15.x or lower.
Thank you for responding. I just installed the MBED Studio yesterday, Before then, I was using the online compiler. In it, the examples used “Serial”, not “BufferedSerial”. With that (the online compiler), I had also recently started using it, and it gave me the impression that it was using the latest everything. Apparently though, it was not. I’ll try BufferedSerial, and let you know how it goes.
In the targets.json configuration file Mbed doesn’t define USBDEVICE for the NUCLEO_F411RE. In addition, the blackpill board is equipped with a 25 MHz external crystal which is not directly supported by Mbed (they use 16 MHz clock source). That’s why I created and published a BLACKPILL custom target which can be used for USB connectivity too. You can find a USBSerial example here.
The following links may help you with USBHID joystick/gamepad:
My advice would be to abandon mBed completely and use ST’s CubeMX and CubeIDE. Makes Serial a whole lot easier and it works, is all free and opensource.
Thanks. I have been considering abandoning mBed, for other reasons anyway, mostly because I have found it very difficult to find working examples and good clear documentation.
My experience has been that the learning curve for mBed is very steep; much steeper that I am willing to endure.
I actually just purchased a Teensy 4.0 and the examples and software for it are straightforward and just work.
I guess I’ll see if CubeMX/IDE is any easier to use.