ラズパイのGPIO出力

2024/01/18

# -*- coding: utf-8 -*-

import RPi.GPIO as GPIO

relay_no = 24

GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(relay_no,GPIO.OUT,initial=GPIO.LOW)

#on
GPIO.output(relay_no,1)
#off
GPIO.output(relay_no,0)


GPIO Outputs
https://sourceforge.net/p/raspberry-gpio-python/wiki/Outputs/