This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
第一个评论说您没有更新LEDSTATE。这是问题。我相信一个更好的解决方案是:
这读取当前的LED状态并使用
!digitalRead(LED)
倒置,而无需if()else {}The first comment said you did not update ledState. This is the problem. I believe a better solution to that is the following:
This reads the current led state and inverts it with
!digitalRead(led)
without the need of an if () else {}