Jetson Nano控制SIM7020 开关机
原创
©著作权归作者所有:来自51CTO博客作者wx6197b8370eecb的原创作品,请联系作者获取转载授权,否则将追究法律责任
原理分析:
import Jetson.GPIO as GPIO
import time
pwr_pin = 7
GPIO.setmode(GPIO.BOARD)
GPIO.setup(pwr_pin, GPIO.OUT)
pwr_pin = 7
GPIO.setmode(GPIO.BOARD)
GPIO.setup(pwr_pin, GPIO.OUT)
try:
print("switch")
GPIO.output(pwr_pin, GPIO.HIGH)
time.sleep(2)
# print("off")
GPIO.output(pwr_pin, GPIO.LOW)
# time.sleep(2)
except KeyboardInterrupt:
GPIO.output(pwr_pin, GPIO.LOW)
GPIO.cleanup()
print("done")
运行程序,拉高7引脚两秒,改变开关机状态: