Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes GPIO not work #13

Open
wsywsya119 opened this issue Feb 22, 2018 · 3 comments
Open

Sometimes GPIO not work #13

wsywsya119 opened this issue Feb 22, 2018 · 3 comments

Comments

@wsywsya119
Copy link

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
Copy link
Member

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

@wsywsya119
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants