This example uses the Keyboard library to log you out of your user session on your computer when pin 2 on the ARDUINO UNO is pulled to ground. The sketch simulates the keypress in sequence of two or three keys on the same time and after a short delay, it releases them.
Warning − whilst you use the Keyboard.print() command, Arduino takes over your pc's keyboard. To ensure you do not lose control of your computer while running a sketch with this function, set up a reliable control system before you call Keyboard.print(). This sketch is designed to only send a Keyboard command after a pin has been pulled to ground.
You will need the following components −
Follow the circuit diagram and hook up the components on the breadboard as shown in the image below.
Open the Arduino IDE software on your computer. Coding in the Arduino language will control your circuit. Open a new sketch File by clicking New.
For this example, you need to use Arduino IDE 1.6.7
Note − You must include the keyboard library in your Arduino library file. Copy and paste the keypad library file inside the file with the name libraries (highlighted) as shown in the following screenshot.
Before you upload the program to your board, make sure you assign the correct OS you are currently using to the platform variable.
While the sketch is running, pressing the button will connect pin 2 to the ground and the board will send the logout sequence to the USB connected PC.
When you connect pin 2 to the ground, it performs a logout operation.
It uses the following keyboard combinations to logout −
Arduino Related Interview Questions
|IBM-REXX Interview Questions||Flash Interview Questions|
|Computer Hardware Interview Questions||Software Engineering Interview Questions|
|PLC/Microcontrollers/Microprocessors Interview Questions||IBM Integration Bus Interview Questions|
|Continuous Integration Interview Questions||C preprocessor Interview Questions|
|8051 Microcontroller Interview Questions||TCS Technical Interview Questions|
|Wipro Technical Interview Questions||Wipro Java Interview Questions|
|Fieldbus Interview Questions||Universe Designer Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.