Raspberry Pi A User Manual page 246

Hide thumbs Also See for Raspberry Pi A:
Table of Contents

Advertisement

230
Figure 14-5:
The example
breadboard
layout for a
simple push-
button input
You don't need to import the time library, because this example doesn't need any timing
instructions. Instead, you can get right to enabling board mode and setting up Pin 12 as an
input. This is done in the same way as setting a pin as an output, with just the final part of
the instruction changed accordingly:
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.IN)
If you're not using Pin 12 for this, make sure you change the pin number in the preceding
instruction.
P A R T I V
H A R D W A R E H A C K I N G

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Raspberry Pi Raspberry Pi A

This manual is also suitable for:

Raspberry pi b

Table of Contents