怎么通过树莓派的GPIO接口控制

作者:立博体育app官网发布时间:2020-06-17已浏览: 114次

123456789101112131415#!/usr/bin/envpython#-*-coding:utf-8-*-importRPi.GPIOasGPIOimporttimeGPIO.setmode()#needtosetupeverychannelwhichareusingasaninputoranoutputGPIO.setup(11,)whileTrue:(11,)(1)(11,)(1)

1234567891011#include<(){wiringPiSetup();pinMode(0,OUTPUT);for(;;){digitalWrite(0,HIGH);delay(500);digitalWrite(0,LOW);delay(500);}}