Wiring up the Circuit#

Referencing the pinout of the Arduino nano in {numref}`

` below, the programmer must first identify where each of the three hardware elements will be connected, ensuring that the pins/ports meet the requirements.

  • For the push button switch, this will be a digital signal (on/off) so can be connected to any GPIO pin.

    • Looking at the other hardware requirements, this should avoid the pins connected to the ADC and leave a full port of input pins for the LEDs. For this example, connection D8 of the nano board is a convenient pin to use, this is connected to PB0, i.e. Port B bit 0[^note].

  • For the analogue input, this can be connected to any of the GPIO pins which is also connected to the ADC.

    • Looking at Fig. 113, these connections are labelled A0A7 on the nano board. Connection A0 is connected to PC0, i.e. Port C bit 0 which is also connected to ADC[0] – ADC channel 0.

  • The LEDs can be connected to any digital GPIO pin, but ideally will be 8 pins on the same port.

    • Looking at Fig. 113 and the two pins we have used above, connections D0D7 can be used which corresponds to Port D bits 0-7[1].

A possible assembly is illustrated in Fig. 114[2]

Arduino Nano Pinout.

Fig. 113 Arduino Nano Pinout - Arduino Nano links.#

A photograph of circuit assembled on breadboard.

Fig. 114 The circuit assembled on breadboard#