Arduino Message De Clavier À Code

When the button is pressed in this example, a text string is sent to the computer as keyboard input. The string reports the number of times the button has been pressed. Once you have the Leonardo programmed and wired up, open up your favourite text editor to see the results.

NB: When you use the Keyboard.print() command, the Arduino takes over your computer’s keyboard! To insure you don’t lose control of your computer while running a sketch with this function, make sure to set up a reliable control system before you call Keyboard.print(). This sketch includes a pushbutton to toggle the keyboard, so that it only runs after the button is pressed.

Software Required

  • Any text editor

Schematic:

Arduino Keyboard Message schematic

Code

/*
Keyboard Button test

For the Arduino Leonardo and Micro.

Sends a text string when a button is pressed.

The circuit:
* pushbutton attached from pin 2 to +5V
* 10-kilohm resistor attached from pin 4 to ground

created 24 Oct 2011
modified 27 Mar 2012
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/KeyboardButton
*/
Major Components in Project

Hardware Required

  • Arduino Leonardo, Micro, or Due board
  • One momentary pushbutton
  • One 10-kiloohm resistor

For more detail: Arduino Message De Clavier À Code


A Propos De L'Auteur

Ibrar Ayyub

Je suis expérimenté, rédacteur technique, titulaire d'une Maîtrise en informatique de BZU Multan, Pakistan à l'Université. Avec un arrière-plan couvrant diverses industries, notamment en matière de domotique et de l'ingénierie, j'ai perfectionné mes compétences dans la rédaction claire et concise du contenu. Compétent en tirant parti de l'infographie et des diagrammes, je m'efforce de simplifier des concepts complexes pour les lecteurs. Ma force réside dans une recherche approfondie et de présenter l'information de façon structurée et logique format.

Suivez-Nous:
LinkedinTwitter

Laisser un Commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

fr_FRFrench
Faire défiler vers le Haut