PRABEEN RAJ
Published © CC BY

Custom End Button For Online Class

My Way of ending online Class

BeginnerFull instructions provided74
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 RAJ
10 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.