I've made simple shortcut buttons to be used with Google Meet (componets on breadboard and the code in python):
- one button connected to some GPIO pin that makes a keystroke (ctrl + e) for toggling the camera;
- a second button connected to another GPIO pin that toggles the mic (ctrl + d); and
- a led that tracks if camera is being used. If yes, led on. Otherwise, led off.
It works fine. Now I want to go further and make it a USB Device. I have been researching/studying about USB standard and how are USB devices implemented. Found about some microcontrollers that are ready for USB, like the ATmega32U2. But I don't want to get into microcontrollers/C programming at the moment. I was thinking about using my RPi 4B to act as a microcontroller.
With my prototype connected to GPIO pins as descibed above I would connect a USB cable to other GPIO pins (but only the data wires) and taking care to use resistor and any electronic components needed to prevent burning anything. Then write the software (probably python) to make the RPi "talk USB" through the cable to another computer or even RPi itself.
Is this idea possible to be done (RPi act as a microcontroller for USB device) or should I drop it and jump to microcontrollers?