prabeen
Published © GPL3+

Custom End Button For Online Class

This is how I End My Online Class

BeginnerProtip1 hour96
Custom End Button For Online Class

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Tactile Switch, Top Actuated
Tactile Switch, Top Actuated
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram

Code

Arduino Code

C/C++
int buttonState = 0;

void setup()
{
  pinMode(2, INPUT);
  Serial.begin(9600);

}

void loop()
{
  // read the input pin
  buttonState = digitalRead(2);
  if(buttonState == 1){
    Serial.println('d');
  }
 
  delay(10); // Delay a little bit to improve simulation performance
}

Python Code

Python
import serial
from pynput.mouse import Button, Controller
ser = serial.Serial('COM3', 9600)#Enter Arduino Port Number Here
mouse = Controller()
while True:
    data = ser.readline()
    if data.decode().strip() == "d":
        mouse.press(Button.left)
        mouse.release(Button.left)
   
        

Arduino and Python Code

Credits

prabeen
4 projects • 1 follower
Engineering In India , Electronics Hobbist , Work With Arduino
Contact

Comments

Please log in or sign up to comment.