Contents
Touch Screens
Displays of any resolution up to 1920x1080 are supported. On my own car I run a 12.3” Stretched Bar display with a resolution of 1920x720. This gives a wide display with an aspect ratio more suited to an instrument cluster.
There are two display types officially supported by SDC:
- HDMI Displays with USB HID capacitive touchscreens
- The official Raspberry Pi Touchscreen
Tochscreens must be capacitive. Resistive touch screens are not typically HID compliant anyway and are not supported.
Momentary Buttons
Momentary style button input is supported by connecting to the Pi’s GPIO pins. Simply connect one terminal of your button to an unused GPIO pin (see the Pi documentation for suitable pins) and connect the other terminal to a ground pin. The inputs are configured to be active low, i.e. when you close the switch the ground pin is connected to the GPIO pin and this causes the pin to be triggered and an associated action to be taken by the software (depending upon what you have configured).
Button inputs can configured to perform any of the predefined actions that can also be performed by a Touch Gauge.
The SDC I/O Hat has inputs for up to 5 buttons. Alternatively a rotary encoder can be used. If you want to navigate around the components on the screen (to implement some sort of menu for example), without a rotary encoder then you will require three buttons:
- A previous button
- A next button
- An Enter button
You can get away with only two if you don’t have many actionable buttons on the screen and only want the buttons to navigate between pages.
There are enough inputs to combine both a rotary encoder and one or more momentary buttons if, for example, you wanted a “home” button to bring up a menu page quickly, as well as the rotary encoder capabilities (although you can still do that using the always page and only a rotary encoder)
See the section on Configuring Hardware Buttons for further information.
Rotary Encoder
Use of a rotary encoder for navigation and control is a bit more intuitive to use and is a bit more flexible. A rotary encoder requires three of the allowable inputs offered by the SDC I/O Hat, plus the power and ground connections. If you don’t have the hat you can connect directly to the pi’s header; it’s just that the hat provides convenient connection points for the inputs.
Most rotary encoders have 5 pins:
- CLK - “pin1” in SDC terms (see the ini file setting link below)
- DT - “pin2” in SDC terms. Note: pin1 and pin2 might be swapped on your encoder.
- SW - the pin attached to the momentary button (grounded when you press the knob)
- VSS - power supply +
- GND - power supply ground.
Many rotary encoders can be powered either by 3.3v or 5v, but for the Raspberry Pi application you should ensure it is powered by 3.3v as this is the voltage level the Pi’s GPIO pins are rated for.
The SDC I/O Hat provides a 3.3v power pin on its Rotary Encoder pin header.
See the section on Rotary Encoder Configuration for further information.