Arduino Switch Case Digital Input

Sin una declaración de interrupción, la sentencia switch continuará la ejecución de las siguientes expresiones hasta que se alcanza una interrupción o hasta el final de la sentencia switch. !Important Informations. Open up your digital world with Arduino - [Instructor] All right, so I'm going to go through the switchcase statement. // our states. PWM (pin 3, 5, 6, 9, 10, and 11 on an Arduino Uno) is not supported yet. An analog signal is one that can take on any number of values, unlike a digital signal which has only two values: HIGH and LOW. Adds 28 digital I/O and 16 Analog Input pins by using just 3 Arduino pins; Two Microchip MCP23017 ICs for digital I/O pins expansion. In the previous tutorial, we have seen How to use pinMode Arduino Command, which sets the Arduino Pin either as Input or Output. microswitches/snap action switches), in this case they are called. Normally connecting an Arduino pin directly to 5V can be a bad idea but we can do it here because Arduino digital pins that are set for INPUT with pinMode have a very high impedance similar to having a 100 megohm resistor in front of the pin. How is it the QWERTY keyboard has been around so long? We used to "hunt & gather" now we "hunt & peck" (or at least I do). Once you understand this post, you will be able to understand all the other posts/tutorials on this website, you will also have algorithmic skills and it will be easy for you to learn other programmation langages. A lot of Arduino examples with code,diagrams and images for arduino beginners and programmers. This allowed it to have all button mode migration to appear to behave the same. It's like a series of if statements. The 'ledPin' is the output pin and 'buttonApin' will refer to the switch nearer the top of the breadboard and 'buttonBpin' to the other switch. We will explain the functioning of the pins in those modes. Problems can occur if the relay module is low triggered. In particular, a switch statement compares the value of a variable to the values specified in case statements. The Arduino code is shown below. IfStatementConditional demonstrates If Statements. switch case 1: testval is the variable that we test with digital signals, inputs and outputs. Hint, if you want to know what PORTx register is associated with a Pin, look at the UNO Schematic… When the pin is configured for OUTPUT, digitalWrite() figures out with Port and Bit to change, and writes to it. 1: Choosing between Pin 3 or the input I0. That input is read by Arduino board and decision is taken accordingly. Dont forget, in digital binary land, HIGH is another word for 1 and LOW is another word for 0. The priority of the Serial Receive block is lesser than Serial Transmit and that of Buzzer block is least. Note that the +5 volts (VCC) from an Arduino digital pin goes to pin 1 and Arduino ground goes to pin 2. A simple sketch I wrote up for the Arduino Uno. How is it the QWERTY keyboard has been around so long? We used to "hunt & gather" now we "hunt & peck" (or at least I do). Anyway, say you have a switch and you want for when you press the switch to bring a digital pin to high(1) and when it's not pressed, to low(0). Communication→SerialCallResponse. Normally connecting an Arduino pin directly to 5V can be a bad idea but we can do it here because Arduino digital pins that are set for INPUT with pinMode have a very high impedance similar to having a 100 megohm resistor in front of the pin. microswitches/snap action switches), in this case they are called. By telleropnul, October 4, 2016. Software Serial is a library of Arduino which enables serial data communication through other digital pins of Arduino. The results were obtained using Arduino software version 1. In this lab, you'll connect a digital input circuit and a digital output circuit to a microcontroller. Basically I want to select the piece of hardware with the outer switch case then select the test with the inner switch case. It receives each character passed to its c parameter, and evaluates it on a case-by-case basis using a switch/case statement. This library, DebouncedSwitch V3. h" void setup() { Serial. Adds 28 digital I/O and 16 Analog Input pins by using just 3 Arduino pins; Two Microchip MCP23017 ICs for digital I/O pins expansion. Connect the LED's anode lead to +12V and connect the 3 RGB cathode leads to digital pins 9, 10, 11 through ULN2003 respectively. With polling you read the input all the time inside a loop. Would this require resistors? Or would you just straight wire from 3. Thursday Week 2: Digital Input and Output 8 Theory and Practice of Tangible User Interfaces. If it is outside these limits, you can bring down the voltage using a voltage divider. Wangdd22 5 PCS Light Detection Digital Switch Mete Output Photosensitive Sensor Module for Arduino so I could properly situate it in my case. Take a look at it and master it. Working Subscribe Subscribed Unsubscribe 31K. !Important Informations. new setting switch case arduino. Overview Inside the tilt switch is a pair of balls that make contact with the pins when the case is upright. This sketch contains both Arduino code and the relevant Processing code for the sketch to work. The only thing to keep in mind is the debounce code in the if statement above the switch. digital read/write not working within switch/case > Using Arduino > Programming Questions > digital read switch input because It does switch the mode if I am. As an Arduino Uno has only 14 digital I/O pins that's half of them used up for the display. Note, in this case, the current limiting resistor must be sized small enough to provide enough current to allow zener breakdown at the correct voltage (about 1 mA minimum). Anyway, say you have a switch and you want for when you press the switch to bring a digital pin to high(1) and when it's not pressed, to low(0). Digital input and output are the most fundamental physical connections for any microcontroller. In this case we read LOW or 0. To enable the pull-down resistor for GPIO16, you have to use INPUT_PULLDOWN_16. pinMode, digitalRead, and digitalWrite functions work as usual, so to read GPIO2, call digitalRead(2). I'll set the first digital pin to high and check the value at each of the 4 inputs. The positive supply taken from the +5V output is connected to the other terminal of the SPST push switch. In today's tutorial, we are gonna have a look at How to use digitalRead in Arduino. PWM (pin 3, 5, 6, 9, 10, and 11 on an Arduino Uno) is not supported yet. Alternate Push Button Module Arduino Circuit. Two push button switches and two LEDs are connected to the Arduino. Conclusion. the same in every case, incorrectly connecting a switch might lead to a dangerous short circuit! input might try to read. We will connect the longer pin of the LED to digital pin number 13. Controlling an LED from an Arduino Web Page Button and a Push Button. The simplest control you can use over an electrical device is digital output. 1 input and disables the Pin 3. 'State change detection' is a method to see when a button is pressed or released. Let´s assume that there is a whole number variable, and that in another part of our program it is updated, the while loop would be like this:. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. The main difference. 5-r2; test programs were build in the Arduino IDE with default settings. In my case I used a small Breadboard. Switch statement Demonstrates the use of a switch statement. The circuit can be modified to operate high power loads with the same toggle switch. Arrays demonstrates Array. Here the switch is connected to digital pin 4 (D4) and LED is connected to digital pin 8 (D8) of Arduino Uno. EE 285 Arduino - 10 The program using the switch is similar to the previous one with the sensor. In this tutorial you will learn how to make your own relay switch circuit for arduino in few easy steps. Arduino Switch (case) Statement, used with serial input Posted date: August 01, 2013 In: Interfacing(USB - RS232 - I2c -ISP) Projects , Projects | Tags: arduino , input , switch An if statement allows you to choose between two discrete options, TRUE or FALSE. If I let go, the second function go into a loop. Arduino Uno R3 1. Wangdd22 5 PCS Light Detection Digital Switch Mete Output Photosensitive Sensor Module for Arduino so I could properly situate it in my case. Or, is there a better way?. Note, in this case, the current limiting resistor must be sized small enough to provide enough current to allow zener breakdown at the correct voltage (about 1 mA minimum). I'll do a quick overview on how it works and show a project example using an Arduino. It links against AVR Libc and allows the use of any of its functions; see its user manual for details. Although the bodies of the switches are square, the pins protrude from opposite sides of the switch. VirtualColorMixer reads Multiple Analog Inputs. The same inputs can also be used as digital inputs. PushButtons can activate an output (eg buzzer or a led) when we press them. microswitches/snap action switches), in this case they are called. Implementing this event source is done at the beginning of the state machine function:. The Arduino code is shown below. To see this sketch in action, but the board and sensor in a well-lit room, open the serial monitor, and and move your hand gradually down over the sensor. The ATmega328 has a total of three input/output ports, port B, port C, and port D. Arduino pin 2 is used in the sketches below, but can be changed. This experiment introduces the if instruction, one of the fundamental programming structures, not only important for computers, but also for the majority of decisions we make in our. A switch that stays in the position it was put is called a latching switch. This is a very simple project that controls a set of LEDs using a DIP switch. Arduino pin 2 is used in the sketches below, but can be changed. The switch statement is a powerful tool for organizing your program, easily allow you to move through complex flowcharts. ME102B Lab 2: Input and Output with the Teensy. OH137 Hall Magnetic Switch Arduino Tutorial This magnetic switch detects the presence of a magnetic field that is in the right direction and provides a low output. The priority of the Serial Receive block is lesser than Serial Transmit and that of Buzzer block is least. Even more maddening might be as your finger gets closer to the switch, the pin's state changes! The fix to these problems is simple: use the Arduino Internal Pull-up Resistor. 1 input and disables the Pin 3. Buy WINGONEER 5V 2 Channel SSR Solid State Relay Board Power Switch High Level Trigger for Arduino UNO Raspberry Pi ARM: Electronics - Amazon. When the terminal is brought to a low logic level, for example by connecting it to ground with a button, the circuit is closed to ground and the. PhysicalPixel triggers LED with Characters. Biasalah perbaikan fitur dan bug-bug nya. X, being X any number of the tables above. Pada tutorial kali ini kita akan belajar tentang konsep digital input output pada Arduino dan bagaimana menggunakan pin digital untuk input dan output nilai digital. In the case of PIN 13, that is found on PORTB, bit 1. We also learn how to protect an input from damage. The center pole is connected to pin 5, which will be an input value we read. Arduino Uno R3 1. PORTB has Arduino pins 8 through 13 on it. Arduino pins are by. SENSE connects to an Arduino digital input pin. With polling you read the input all the time inside a loop. ‣Reading on. This scales the input voltage to allow for analog or digital readings of voltages otherwise outside the allowed range. With Arduino C, small if/then state-machines generally come out smaller a switch/case version. The switch-case pattern is rather typical for a simple state machine implementation. The Pin number is set to 5 corresponding to Buzzer. It can be used for digital input. Note, in this case, the current limiting resistor must be sized small enough to provide enough current to allow zener breakdown at the correct voltage (about 1 mA minimum). Arduino Switch Case Statements & Keyboard Input. Jadi kita bukan bikin program arduino, tapi bikin sketch arduino, begitu kata orang-orang di luar sana. It's important to note that: Each pin can provide/sink up to 40 mA max. Take a look at it and master it. It's like a series of if statements. This method is made possible with the SoftwareSerial Library of Arduino. 2 will debounce a switch connected from an Arduino digital input to GND. The following labs are about introducing Digital Inputs and Outputs as well as Analog Inputs and Outputs with the Arduino: Digital Input and Output with an Arduino; Analog In with an Arduino; Servo Motor Control with an Arduino; Tone Output Using an Arduino; Sensor Change Detection. If I let go, the second function go into a loop. The pushbutton works by allowing +5V to be applied to Pin 7 when it's pressed. in order to switch in the internal pull-up resistor to pull the button pin to 5V. Keep the tilt switch position in upright position as indicated in the figure shown below. Switches are really simple components. Digital I/O. Pin 2 will be a good choice for our example. Copy, Paste and Upload the Code. Hi there, I've got a NodeMCU board with a flash switch and a user switch. Although the bodies of the switches are square, the pins protrude from opposite sides of the switch. switch is used in conjunction with break which will also be explained in this part of the course. ME102B Lab 2: Input and Output with the Teensy. Normally if you have an input pin with nothing connected to it, its state will hover between low and high values. Like if statements, switch case controls the flow of programs by allowing programmers to specify different code that should be executed in various conditions. This experiment introduces the if instruction, one of the fundamental programming structures, not only important for computers, but also for the majority of decisions we make in our. Arduino pin 2 is used in the sketches below, but can be changed. Easily add more digital inputs and outputs to your Arduino. On a MDuino 19R Relays/Analog/Digital PLUS this switch is not connected. The Grove-Tilt Switch is the equivalent of a button, and is used as a digital input. Now connect the Arduino board to the computer with the USB cable, and open the example program. switch Statement Example. When there are more than two options, you can use multiple if statements, or you can use the switch statement. Suppose we have a variable phase with only 3 different states (0, 1, or 2) and a corresponding function (event) for each of these states. A keyState of 1023 means that no buttons are pressed, so you'll have to change that to a boolean value for example to determine whether any button is pressed. Alternate Push Button Module Arduino Circuit. Grove 3-Axis Digital Compass HMC5883L: This is an Arduino library for Grove 3-Axis Digital Compass HMC5883L. Arduino library for the AD7390 digital to analog converter (DAC) Switch: Arduino library for deglitching and debouncing switches and buttons. When contact is made by reed switch the input voltage appears on the arduino digital pin. The Arduino Code /* Switch statement with serial input Demonstrates the use of a switch statement. Contains Examples from Basics, Digital, Analog, Communication Control Structures, Sensors, Core Functions, Digital, Display, Strings, USB (Leonardo, Micro, and Due specific examples), Keyboard,Mouse. Switches can be spring loaded (e. Arduino pin 2 is used in the sketches below, but can be changed. Biasalah perbaikan fitur dan bug-bug nya. Pin 16 can be INPUT, OUTPUT or INPUT_PULLDOWN_16. PhysicalPixel triggers LED with Characters. When the magnetic field is removed, the two materials then separate and the switch will open. In the Arduino + Pushbutton article we used a pushbutton as an input device connected to a DIGITAL I/O pin. The code reads the voltage through the analog input A0. In Arduino UNO, there are two interrupt pins digital pins - 2 and 3 denoted by INT. Arduino Tip : Turn your Analog pins into Digital I/O Posted Apr 5 2012 by waihung in Arduino with 13 Comments Recently I've just found out that I can actually turn my Analog input pins into Digital Inputs or Outputs. In this case, we. The main difference. Grove 3-Axis Digital Gyro: Arduino library to control Grove 3-Axis Digital Gyro base on ITG 3200. Using the Switch() Statement As Sequencing Control: In this Instructable, we'll be going over the "switch()" statement and it's use in programming. closed = ON). A pushbutton is a type of switch that closes, and makes an electrical connection, when you press the button. sub main() do if getPin(12) = 1 then ' if the switch is closed on pin 12 call putPin(13,1) ' set pin 13 high end if loop end sub Digital output. In the code, we use the analogWrite function to output a PWM signal. You may wish to power your NodeMCU another way. A few wires. So, in this case we used a button, but that's just one kind of digital input! What else can you use? Switch - Add physical control to toggle different sections of code. For the Relay Shield if a switch is set to ON, it can only act as Digital Output. In the case of PIN 13, that is found on PORTB, bit 1. Using the Switch() Statement As Sequencing Control: In this Instructable, we'll be going over the "switch()" statement and it's use in programming. And we've connected it to pin 2 so we've written 0 there. Adds 28 digital I/O and 16 Analog Input pins by using just 3 Arduino pins; Two Microchip MCP23017 ICs for digital I/O pins expansion. In this tutorial we will be using an Arduino to control the speed and direction of a DC Motor. Phidgets Digital Inputs fall into one of two categories: Active Low and Active High. The priority of the Serial Receive block is lesser than Serial Transmit and that of Buzzer block is least. Copy, Paste and Upload the Code. Suppose we have a variable phase with only 3 different states (0, 1, or 2) and a corresponding function (event) for each of these states. The 'setup' function defines the ledPin as being an OUTPUT as normal, but now we have the two inputs to deal with. com FREE DELIVERY possible on eligible purchases. In this case, we use the set the pinMode to be 'INPUT_PULLUP' like this:. sub main() do if getPin(12) = 1 then ' if the switch is closed on pin 12 call putPin(13,1) ' set pin 13 high end if loop end sub Digital output. This allowed it to have all button mode migration to appear to behave the same. At times I feel short of digital pins on the Arduino to handle multiple button inputs. Switches, Debouncing and the Arduino. Digital signals. Each time through the loop, the switch voltage is measured and compared to the current stored value. Reed switch - Sense whether a door is open or closed, using these two-part magnetic switches. This library, DebouncedSwitch V3. A simple sketch I wrote up for the Arduino Uno. In this case, you would either turn something off, or on. Arduino library to control Grove 3-Axis Digitial Compass v2. On a MDuino 19R Relays/Analog/Digital PLUS this switch is not connected. the input pin. begin(115200. These inputs will report TRUE when the switch is closed and FALSE when the switch is open. Loading Unsubscribe from EEEnthusiast? Cancel Unsubscribe. Increase them if your switch needs it. The shutter wire from the shutter release cable goes to pin 5 and ground from the shutter release goes to pin 4. You probably wouldn't stay sane if your lamp were to continuously blink so it's a good idea to learn how to control it. Arduino IDE terakhir update tanggal 24 desember 2016 ini versi 1. These buttons will only be read correctly if only one is pushed at any time though. Arduino pins are by. If it is outside these limits, you can bring down the voltage using a voltage divider. Code for gsm module interfacing with Arduino. the Atmel chip powering the Arduino board) has several I/O pins. There are two main types of state machines: Mealy and Moore. The priority of the Serial Receive block is lesser than Serial Transmit and that of Buzzer block is least. In Arduino UNO, there are two interrupt pins digital pins - 2 and 3 denoted by INT. By the end, you will have single switch to control colors of the LED strip. You may wish to power your NodeMCU another way. In this article we examine the use of push-wheel/thumbwheel switches with our Arduino systems. It's like a series of if statements. How is it the QWERTY keyboard has been around so long? We used to "hunt & gather" now we "hunt & peck" (or at least I do). To enable the Arduino pins with Home Assistant, add the following section to your configuration. (Here is the schematic for this project). It receives each character passed to its c parameter, and evaluates it on a case-by-case basis using a switch/case statement. This sketch contains both Arduino code and the relevant Processing code for the sketch to work. Arduino Tip : Turn your Analog pins into Digital I/O Posted Apr 5 2012 by waihung in Arduino with 13 Comments Recently I've just found out that I can actually turn my Analog input pins into Digital Inputs or Outputs. Switches can be spring loaded (e. Arduino Lesson 6. Arduino is equipped with many different input and output connectors, which we will refer to as IO Pins. Once you understand this post, you will be able to understand all the other posts/tutorials on this website, you will also have algorithmic skills and it will be easy for you to learn other programmation langages. A lot of Arduino examples with code,diagrams and images for arduino beginners and programmers. Take a look at it and master it. In this case we read LOW or 0. 10KΩ resistor is used as PULL-UP resistor and a 680Ω resistor is used to limit the current through the LED. An LED stands for light-emitting diode - it's basically a small light that you'll be able to turn on and off with your button. Arduino Switch Case Statements & Keyboard Input. The 'setup' function defines the ledPin as being an OUTPUT as normal, but now we have the two inputs to deal with. Note that the +5 volts (VCC) from an Arduino digital pin goes to pin 1 and Arduino ground goes to pin 2. In our switch statement, we'l. The shutter wire from the shutter release cable goes to pin 5 and ground from the shutter release goes to pin 4. We often see may of electronics hobbyist especially arduino user buy expensive relay module instead of building their own. Keep the tilt switch position in upright position as indicated in the figure shown below. That input is read by Arduino board and decision is taken accordingly. The pins on the Arduino board can be configured as either inputs or outputs. We will begin with the simplest digital sensor, the switch. Two push button switches and two LEDs are connected to the Arduino. Here is a simple example with switch. Contribute to arduino/ArduinoCore-avr development by creating an account on GitHub. Push Button Module Arduino Sketch. Also, the Arduino Pin (to which the Reed Switch is connected) is pulled HIGH with the help of a Pull-up Resistor. 'State change detection' is a method to see when a button is pressed or released. It links against AVR Libc and allows the use of any of its functions; see its user manual for details. VirtualColorMixer reads Multiple Analog Inputs. Im using my 6 analog inputs from my Arduino Uno already in my project. Even more maddening might be as your finger gets closer to the switch, the pin's state changes! The fix to these problems is simple: use the Arduino Internal Pull-up Resistor. I gets 1 and 0 from the digital read of the input pins no matter if the pin is connected or not and if i simply hold the wire connecting to the pins. Continuous. Phidgets Digital Inputs fall into one of two categories: Active Low and Active High. An if statement allows you to choose between two discrete options, TRUE or FALSE. Easily add more digital inputs and outputs to your Arduino. Arduino Programming - State change How to program a state change functionality. The switch-case pattern is rather typical for a simple state machine implementation. Continuous. Arduino boards are able to read analog or digital input signals from different sensors and turn it into an output such as activating a motor, turning LED on/off, connect to the cloud and many other actions. Â To connect push button to arduino, we need one of the digital I/O pins configured as a digital input. Arduino Reference (extended) The Arduino language is based on C/C++ and supports all standard C constructs and some C++ features. To measure the value of analog signals, the Arduino has a built-in analog-to-digital converter. An if statement allows you to choose between two discrete options, TRUE or FALSE. Figure 14: Reading large input voltage digital inputs. Pin 4 will be digital HIGH or 1, and pin 6 will be digital LOW or 0. Arduino pins are by. Connect one end of the Reed Switch to a Digital I/O Pin of the Arduino (which is configured as an Input) and the other end is connected GND. Switch (case) Statement, used with serial input. Switch statement Demonstrates the use of a switch statement. We used internal pull up resistors so that we could connect a pushbutton directly between digital I/O pin 8 and GND. Conclusion. There are two main types of state machines: Mealy and Moore. More generally. Grove 4-Digit Display: Arduino library to control Grove_4Digital_Display TM1637. The pins on the Arduino board can be configured as either inputs or outputs. For that, instead of an LED, Connect a relay with the Arduino output. NodeMCU ESP-12E Arduinio IDE Digital Input Tutorial Connect the Circuit. 'State change detection' is a method to see when a button is pressed or released. Then 230V/110V AC loads or similar loads can. This scales the input voltage to allow for analog or digital readings of voltages otherwise outside the allowed range. Grove-Tilt Switch is the equivalent of a button, and is used as a digital input. So, in this case we used a button, but that's just one kind of digital input! What else can you use? Switch - Add physical control to. It seems the keyboard is a long lasting human interface device that will be around for at least until the singularity, so we might as well make the best use of it. It is common used in speed and proximity applications. Structure In Arduino, the standard program entry point (main) is. Support for switching pins is limited to high/on and low/off of the digital pins. So it was SWITCH/CASE to the rescue. In this case, we use the set the pinMode to be 'INPUT_PULLUP' like. Each time through the loop, the switch voltage is measured and compared to the current stored value. It is wired to the SIG line, NC is not used on this Grove module. Am I going to blow some pins up on the arduino by connecting an output to an input? If not I'll continue. The following labs are about introducing Digital Inputs and Outputs as well as Analog Inputs and Outputs with the Arduino: Digital Input and Output with an Arduino; Analog In with an Arduino; Servo Motor Control with an Arduino; Tone Output Using an Arduino; Sensor Change Detection. This is the first and perhaps most basic of inputs that you can and should learn for your Arduino projects: the modest pushbutton. In this example, I have set pin number 7 as a digital input. It gives you an illusion of analog values, in between LOW and HIGH. In our case on Door(Pin#9) pin. The switch-case pattern is rather typical for a simple state machine implementation. I'll set the first digital pin to high and check the value at each of the 4 inputs. The way it works is very straightforward: use a resistor network as voltage dividers, and then let each button feed a different voltage to the. Connect one end of the Reed Switch to a Digital I/O Pin of the Arduino (which is configured as an Input) and the other end is connected GND. The problem is, I must hold the button to get the first function. For that, instead of an LED, Connect a relay with the Arduino output. With Arduino C, small if/then state-machines generally come out smaller a switch/case version. In this tutorial we will learn How to interface a Push Button Switch with Raspberry Pi using Python Programming - GPIO Input Pin internal Pull Up resistor. Sometimes if I let go, it seems that it's working fine and it's waiting for input. In contrast, when a switch is closed, current flows (i. The pins are all connected when you press on the switch. Alternate Arduino Internal Pull-Up Resistor Tutorial. At times I feel short of digital pins on the Arduino to handle multiple button inputs. Thus pin D4 should be declared as INPUT and pin D8 as OUTPUT in the sketch (program). The code reads the voltage through the analog input A0. X, being X any number of the tables above. La palabra reservada break interrumpe la sentencia switch, y se usa normalmente al final de cada declaración case. It receives each character passed to its c parameter, and evaluates it on a case-by-case basis using a switch/case statement. Software Serial is a library of Arduino which enables serial data communication through other digital pins of Arduino. To enable the Arduino pins with Home Assistant, add the following section to your configuration. The connection of 4 relay module to an Arduino is very easy and allows you to control many devices through Arduino (both A. We also learn how to protect an input from damage. Pin numbers in Arduino correspond directly to the ESP8266 GPIO pin numbers. Contains Examples from Basics, Digital, Analog, Communication Control Structures, Sensors, Core Functions, Digital, Display, Strings, USB (Leonardo, Micro, and Due specific examples), Keyboard,Mouse. This means that, the Arduino will always read the Input on this pin as HIGH. Here is an easy way to use 1 analog pin to handle many input buttons.