user68929: I would like to read the output of an on-off-on switch with my Leonardo board, but I have very little knowledge of electronics and don't know how to wire it up.
This is the switch in question: E-Switch 200MSP4T1B1M1QE
The switch has three pins. Generic three-pin SPDT wiring diagrams I've found suggest that the two outer pins should be connected to separate lights and the middle pin should be connected to the power source. Those lights also have a ground connection.
I don't want to power anything in a literal sense, I only want to have the Leonardo read the output of the switch. The end goal is to have the two ON positions read as separate button presses (eventually using a joystick library, in case that changes how the switch needs to be wired).
My questions are:

Is the above wiring example correct for my use case?
Is the output of the switch considered digital or analog?
Is a wire from the switch to GND not required?

One final note - I'm not using a breadboard, but connecting the wires directly from the switch to the board.

user2967: You talk about wiring a switch to control lights directly. Instead, you want to use your switch to send information to your Arduino.
You link to an SPDT (single pole, double throw) switch. When flipped one way, it connects the center pin to one of the outside pins, and when flipped the other way, it connects the center pin to the other outside pin.
If you want the Leonardo to read the state of the switch as 2 separate switches/button presses, wire the 2 outer pins of the switch to 2 separate digital inputs on the Arduino.
You need to force each input to either ground or +5V when it's not connected to anything, or it will "float" and you'll get semi-random high and low readings.
I suggest setting the Arduino input pins to INPUT_PULLUP mode. That connects the inputs internally through a resistor to +5V. If you don't connect anything to the pin, it reads as HIGH. When the button is pressed/switch is closed, it reads LOW. That might seem a little confusing, but it means you don't need external resistors.
You'd then attach those to pins to the two outer pins of your switch, and attach the center pin to ground (GND).
If you flip the switch one way, it would connect one outer pin to the center pin. That would connect that Arduino pin to ground, and the reading on the pin would drop from HIGH to LOW. Flip the switch the other way and it would connect the other pin to ground, at that other pin would drop from HIGH to LOW.
It is also possible to wire your switches using INPUT mode, not INPUT_PULLUP, and have them read LOW when the switch is open, and HIGH when closed, but to do that you'll need external pull-down resistors. (And wiring it will be a little painful without a breadboard or PC board.)
To answer your questions:

Is the above wiring example correct for my use case?

You don't show a wiring example. You talk about how to wire a switch to switch power to a pair of lights directly, without using a microcontroller. That's not relevant here.

Is the output of the switch considered digital or analog?

It would make sense to use it as a digital input, since you need it to give you 2 states, open and closed.

Is a wire from the switch to GND not required?

You need to connect the center pin to either ground +5V, as discussed above.

user7508: I suggest this simple circuit:

simulate this circuit – Schematic created using CircuitLab
Set both inputs to INPUT_PULLUP. If the input reads LOW, that means it has been grounded by the switch.

Edit: Per Duncan’s request, here is the alternative circuit with the polarities inverted. With the switch’s common connected to Vcc, the inputs should be set to INPUT_PULLDOWN. However, most Arduinos do not support this mode, for lack of internal pull-downs. Then one has to use external pull-downs instead, and set the pins to INPUT.

simulate this circuit
With this circuit, a pin reads HIGH when it is connected to +5V by the switch.

68929: <p>I would like to read the output of an on-off-on switch with my Leonardo board, but I have very little knowledge of electronics and don't know how to wire it up.</p>
<p>This is the switch in question: <a href="https://www.digikey.ca/en/products/detail/e-switch/200MSP4T1B1M1QE/3777910" rel="nofollow noreferrer">E-Switch 200MSP4T1B1M1QE</a></p>
<p>The switch has three pins. Generic three-pin SPDT wiring diagrams I've found suggest that the two outer pins should be connected to separate lights and the middle pin should be connected to the power source. Those lights also have a ground connection.</p>
<p>I don't want to power anything in a literal sense, I only want to have the Leonardo read the output of the switch. The end goal is to have the two ON positions read as separate button presses (eventually using a joystick library, in case that changes how the switch needs to be wired).</p>
<p>My questions are:</p>
<ol>
<li>Is the above wiring example correct for my use case?</li>
<li>Is the output of the switch considered digital or analog?</li>
<li>Is a wire from the switch to GND not required?</li>
</ol>
<p>One final note - I'm not using a breadboard, but connecting the wires directly from the switch to the board.</p>
 2967: <p>You talk about wiring a switch to control lights directly. Instead, you want to use your switch to send information to your Arduino.</p>
<p>You link to an SPDT (single pole, double throw) switch. When flipped one way, it connects the center pin to one of the outside pins, and when flipped the other way, it connects the center pin to the other outside pin.</p>
<p>If you want the Leonardo to read the state of the switch as 2 separate switches/button presses, wire the 2 outer pins of the switch to 2 separate digital inputs on the Arduino.</p>
<p>You need to force each input to either ground or +5V when it's not connected to anything, or it will &quot;float&quot; and you'll get semi-random high and low readings.</p>
<p>I suggest setting the Arduino input pins to INPUT_PULLUP mode. That connects the inputs internally through a resistor to +5V. If you don't connect anything to the pin, it reads as HIGH. When the button is pressed/switch is closed, it reads LOW. That might seem a little confusing, but it means you don't need external resistors.</p>
<p>You'd then attach those to pins to the two outer pins of your switch, and attach the center pin to ground (GND).</p>
<p>If you flip the switch one way, it would connect one outer pin to the center pin. That would connect that Arduino pin to ground, and the reading on the pin would drop from HIGH to LOW. Flip the switch the other way and it would connect the other pin to ground, at that other pin would drop from HIGH to LOW.</p>
<p>It is also possible to wire your switches using INPUT mode, not INPUT_PULLUP, and have them read LOW when the switch is open, and HIGH when closed, but to do that you'll need external pull-down resistors. (And wiring it will be a little painful without a breadboard or PC board.)</p>
<p>To answer your questions:</p>
<ol>
<li>Is the above wiring example correct for my use case?</li>
</ol>
<p>You don't show a wiring example. You talk about how to wire a switch to switch power to a pair of lights directly, without using a microcontroller. That's not relevant here.</p>
<ol start="2">
<li>Is the output of the switch considered digital or analog?</li>
</ol>
<p>It would make sense to use it as a digital input, since you need it to give you 2 states, open and closed.</p>
<ol start="3">
<li>Is a wire from the switch to GND not required?</li>
</ol>
<p>You need to connect the center pin to either ground +5V, as discussed above.</p>
 7508: <p>I suggest this simple circuit:</p>

<p><img src="https://i.stack.imgur.com/qzj4K.png" alt="schematic" /></p>

<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fqzj4K.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>
<p>Set both inputs to <code>INPUT_PULLUP</code>. If the input reads <code>LOW</code>, that means it has been grounded by the switch.</p>
<hr />
<p><strong>Edit</strong>: Per Duncan’s request, here is the alternative circuit with the polarities inverted. With the switch’s common connected to Vcc, the inputs should be set to <code>INPUT_PULLDOWN</code>. However, most Arduinos do not support this mode, for lack of internal pull-downs. Then one has to use external pull-downs instead, and set the pins to <code>INPUT</code>.</p>

<p><img src="https://i.stack.imgur.com/nMBOZ.png" alt="schematic" /></p>

<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fnMBOZ.png">simulate this circuit</a></sup></p>
<p>With this circuit, a pin reads <code>HIGH</code> when it is connected to +5V by the switch.</p>
