Python defin上的语法无效

2024-10-02 16:23:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我做了一段代码来测量我的rpi的cpu温度,如果在GPIO端口7上发送信号的温度超过60摄氏度,如果不超过60摄氏度,则不在端口上发送信号,但我得到了以下错误:

 File "tempgate.py", line 17
    def FanController(CPU_temp) :
      ^
SyntaxError: invalid syntax

文件是:

^{pr2}$

Tags: 端口代码pygpio信号def错误line