Trigger Mouse Click

Hello,

I am newbie here ... and seeking some help from you guys.

i want to write a program that could trigger one right mouse click when there is an input of 5 V "High" on PIN 2. The input could be changed to 2.2 V "Low".

The 5 V signal could last for 200 m sec and i just need one right mouse click with each high signal.

I am using Arduino Leonardo Board.

Also, is there anything could be done to simulate this before i test it with the real output?!

Thanks in advance..

The 5 V signal could last for 200 m sec and i just need one right mouse click with each high signal.

Look at the state change detection example.

Also, is there anything could be done to simulate this before i test it with the real output?!

You mean something like this?

int pinState = HIGH; // will become digitalRead(somePin);
if(pinState == HIGH)
{
   //Send a right click...

Many Thanks PaulS for your prompt reply :slight_smile: .

I will try this example but i meant is there anyway to simulate the whole environment? Is there any application or something to be used to produce this kind of signal to my board ?

Thanks for your help.