I've been having some difficulties with getting a compile to succeed for a Teensy 4 when my code utilizes the Keyboard library.
The code only successfully compiles (when it includes the command (Keyboard.print("A")) if the Arduino IDE menu item "USB Type:" is set to "Keyboard" instead of "Serial" (which causes a "Keyboard was not declared in this scope" error).
What exactly does changing the "USB Type:" menu item do to the compiling/linking process in the Arduino IDE that allows it to succeed? The ultimate reason I want to know is because I am using the same code with PlatformIO, and it is currently failing with the same error.....so I will be trying to perform the same "magic" that the Arduino "USB Type:" menu item does in PlatformIO as well.
The code only successfully compiles (when it includes the command (Keyboard.print("A")) if the Arduino IDE menu item "USB Type:" is set to "Keyboard" instead of "Serial" (which causes a "Keyboard was not declared in this scope" error).
What exactly does changing the "USB Type:" menu item do to the compiling/linking process in the Arduino IDE that allows it to succeed? The ultimate reason I want to know is because I am using the same code with PlatformIO, and it is currently failing with the same error.....so I will be trying to perform the same "magic" that the Arduino "USB Type:" menu item does in PlatformIO as well.