On my windows xp i have an old alarm. When alarm turns on the screen changes from black to red. With my arduino i want to sent a keyboard.write('1'); back to the computer so it can sent a SMS. How do i trigger event to happen.
#include "Keyboard.h"
void setup() {
// put your setup code here, to run once:
Keyboard.begin();
delay(60000);
}
If you want the Arduino to know that the PC alarm has triggered you will need a program on the PC to send a message to the Arduino. Then the Arduino can send a message back to the PC to tell the PC to do something.
I don't see a role for the Arduino in this project. Why not just get the alarm to trigger the PC program directly. That is a very common thing to do on PCs.
zoomkat:
You might use an arduino connected photo transistor/resistor against the monitor screen to detect a change in monitor brightness.
Maybe the OP could program the PC to cause a small square on the PC screen to flash at a particular frequency that the Arduino could detect with the photo transistor ?