Getting Started with Raspberry Pi GPIO for IoT

Getting Started with Raspberry Pi GPIO for IoT

Chapter 1: Basics of RPi.GPIO Module Importing the Module To import the RPi.GPIO module: import RPi.GPIO as GPIO By doing this, you can refer to it as GPIO for the rest of this script. You can check if the module was imported successfully by throwing an exception: try: import RPi.GPIO as GPIO except RuntimeError: print(“Error … Read more