# Is there a way to turn and off light by clicking my mouse on computer?

**URL:** <https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716>\
**Category:** General Guidance\
**Created:** [November 27, 2022, 8:08pm UTC](https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716 "2022-11-27T20:08:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hflood](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@hflood](https://forum.arduino.cc/u/hflood)\
**Post date:** [November 27, 2022, 8:08pm UTC](https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716/1 "2022-11-27T20:08:31Z")

</div>

Hello, all. I am new and wanted to try turning it on and off led by clicking on my PC. But nowhere I could find a tutorial on something similar.  
So I want to ask if that is even possible.

---

<div class="post-metadata">

**Author:** ![lastchancename](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lastchancename/32/215426_2.png) [@lastchancename](https://forum.arduino.cc/u/lastchancename)\
**Post date:** [November 27, 2022, 8:59pm UTC](https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716/2 "2022-11-27T20:59:47Z")

</div>

Assuming you want to use an Arduino in some way, the first thing you need to addres **s is how you’re going to communicate from the PC to the Arduino.**

Serial, LAN, WiFi, Bluetooth etc. ?

Of course, you can build an interface on the PC that doesn’t need an Arduino at all.

Maybe take a breath, and explain your project and what, where and why it needs to do this.

---

<div class="post-metadata">

**Author:** ![hflood](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@hflood](https://forum.arduino.cc/u/hflood)\
**Post date:** [November 27, 2022, 9:21pm UTC](https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716/4 "2022-11-27T21:21:18Z")

</div>

I have Arduino Uno so the best probably is to communicate through the USB cable that goes into it. I want to basically just make that when I click the mouse, the diode will glow up

---

<div class="post-metadata">

**Author:** ![lastchancename](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lastchancename/32/215426_2.png) [@lastchancename](https://forum.arduino.cc/u/lastchancename)\
**Post date:** [November 27, 2022, 9:46pm UTC](https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716/5 "2022-11-27T21:46:07Z")

</div>

ok, that makes it easier.  
You’ll need a way to monitor the mouse clicks on the PC, then send those out through the selected com port.  
TheArduino code is pretty easy once you know what to be expected from the PC.

You can use almost any PC programming language to collect and send the mouse clicks.

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [November 27, 2022, 9:49pm UTC](https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716/6 "2022-11-27T21:49:02Z")

</div>

> [@hflood](#):
>
> So I want to ask if that is even possible.

Yes but you have to write a program on your computer, that will detect a mouse click which will then send the Arduino a message over the serial port.

You can write this program on your computer in any language you can run on your computer. A favourite one is the Free language Processing, it has a C like syntax so is easy to pick up.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 26, 2023, 9:49pm UTC](https://forum.arduino.cc/t/is-there-a-way-to-turn-and-off-light-by-clicking-my-mouse-on-computer/1058716/7 "2023-05-26T21:49:10Z")

</div>

Closed on May 26, 2023, 9:49pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
