LattePandaTeam / LattePanda-Development-Support

43 stars 81 forks source link

Sometimes GPIO not work #13

Open wsywsya119 opened 6 years ago

wsywsya119 commented 6 years ago

Hi everyone. I use the newest Arduino.cs code by lafrank which help reducing the CPU usage.

And test LED blink code like this: Controller.digitalWrite(doorPin, Arduino.HIGH); Thread.Sleep(2000); Controller.digitalWrite(doorPin, Arduino.LOW);

It works at start but sometimes not blink after a while.

I observed the LED on the board is always on with the old Arduino.cs However. Use the newest Arduino.cs is not. Any idea about it? Thanks.

LattePanda commented 6 years ago

How about do like this: Controller.digitalWrite(doorPin, Arduino.HIGH); Thread.Sleep(2000); Controller.digitalWrite(doorPin, Arduino.LOW); Thread.Sleep(2000);

wsywsya119 commented 6 years ago

I tried but still not work. I did't call my blink function frequently. So maybe the problem is not the Thread.sleep. I remove the sleep and just use Arduino.HIGH, Arduino.LOW to turn it on/off. Still got the same result. Sometimes the LED is not responded as my command.

wsywsya119 commented 6 years ago

BTW. I download the entire demo project and test it. When I click Turn off/on D13 Led button. It work fine at start. But a little delay after a while. The delay time is about 1~3 second.