How is it possible to detect (via code) if a Teensy LC has established a usb-connection?
I need to know this, because I have created a program that sets the Teensy LC to hibernate mode and only wakes up every x minutes
to check if a certain voltage at a certain analog input has been reached, and if not it immediately goes back to sleep.
To program the Teensy when the cpu is in hibernate mode it is necessary to press the program-button to upload the code, but the Teensy is placed in a housing where the reset button is hardly reachable, so I need a solution that when the Teensy awakes from hibernate mode it first will check if a usb-connection has been established and if so it will not go back to hibernate mode, so that programming is possible without pressing the program-button.
Thanks for the answers in advance!
I need to know this, because I have created a program that sets the Teensy LC to hibernate mode and only wakes up every x minutes
to check if a certain voltage at a certain analog input has been reached, and if not it immediately goes back to sleep.
To program the Teensy when the cpu is in hibernate mode it is necessary to press the program-button to upload the code, but the Teensy is placed in a housing where the reset button is hardly reachable, so I need a solution that when the Teensy awakes from hibernate mode it first will check if a usb-connection has been established and if so it will not go back to hibernate mode, so that programming is possible without pressing the program-button.
Thanks for the answers in advance!