This sounds familiar.
It is similar to that post in that we are both using the same tools for keyboard injection via a USB connection. It gets plugged into the chromebook via USB and then begins injecting keystrokes according to a script to go through the Chromebook enrollment process. That part works just fine.
I am now trying to tweak the code to make it more intelligent and determine if it is plugged into a PC and not a Chromebook so it won't execute the script if someone accidentally plugs it in.
I would turn that around.
Don't have the Arduino start sending out any data (I assume that's over the Serial console) unless asked for explicitly. So your PC has to send a special command, maybe with password, for the Arduino to start sending stuff.
I like that idea and would like to explore it further. I will take a look at Serial Input Basics and some others.
I still would like to have it to not do anything when connected to the PC. This is because we plan on giving some of these devices to non-technical people in remote locations so they can take care of their own enrollment without having to know any of the credentials. But I need to plan on them accidentally plugging it into one of the PCs, which could cause issues. It would also be nice for when I connect it to my PC to upload any changes to the code.
I know that you can do a lot with Arduino. But my problem is that I don't know exactly what it can do. So my basic question is this. Is there any way to plug this arduino into the USB port of a Chromebook or PC and have it query the connected computer to determine what it is?