On mouse over question for Arduino Leonardo

I have the following problem.

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);
}

void loop() {
Keyboard.write('1');
delay(5000);

}

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.

...R

Thanks for the fast reply. No i need to Arduino to sent "SMS" to the computer. The Arduino needs to be triggered by a color on the monitor.

I was thinking something like check if color of pixel is red or not if red then sent "1" to pc.

The Arduino needs to be triggered by a color on the monitor.

The Arduino has no idea what colors are appearing on hardware attached to another computer. You need an application on the PC that can know that.

I still don't see a role for the Arduino. It need not care what is happening on the PC. The PC can know, and can do something about it.

koetjeownz:
No i need to Arduino to sent "SMS" to the computer.

...SNIP...

then sent "1" to pc.

Are you planning to send the '1' in an SMS ? Why?

I don't understand why you need to send anything to the PC because the PC already knows when something needs to happen.

And I can't relate any of this to your Title.

I suspect there is something about this project that you have not explained sufficiently.

...R

You might use an arduino connected photo transistor/resistor against the monitor screen to detect a change in monitor brightness.

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 ?

...R