Help making a USB trigger, VB.NET coding, and interfacing the two in a wonderful harmony of code and circuits.
Alright, so what I've got to do here is detect when a door is opened via a sensor (I've figured out that as far as practicality goes an ultrasonic or motion sensor would be the best, but I'm also considering a simple magnetic switch for the sake of simplicity and cost), and then play an audio file. I'd REALLY REALLY REALLY like to keep as much of the coding as possible done in VB.NET, and I don't want the end result to require the user to open five different programs, I want them to open the one .exe file, and that's it. My problem here is actually getting the trigger to talk to VB.NET, I've never done any peripherals with VB.NET, so I'm pretty clueless. I don't need the trigger to respond with any data other than some sort of ping that VB.NET can pick up.
I've also been thinking about using the ultrasonic/motion sensor to interface with a USB keyboard encoder, to output some obscure character, and then have VB.NET watch for that character, and react when it's pressed. The problem here is that I don't want the program to have to be the main window, I want the user to be able to have it open and not worry about it.
Any help that anyone can give me with either the coding side or with the trigger side is really appreciated, thank you all in advance :)