You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
Hi Martino,
Thx for looking into it. I was making art with the onboard leds.
:-)
It looks like analog calling the 5th channel is what caused the
hanging problem.
Apparently assigning a PWM channel stops digitalWrite from
working on that pin .
Is there a (user friendly) way to free up the Pin channel in a
sketch, so that digitalWrite works again? Possibly reassign the
channel to another pin?
Kind regards
Femme Verbeek.
code
void setup()
{ pinMode(LED_BUILTIN,OUTPUT);
analogWrite(LED_BUILTIN,75);
digitalWrite(LED_BUILTIN,1);
delay(1000);
digitalWrite(LED_BUILTIN,0);
}
void loop(){}
I've hit this problem also. digitalWrite after an analogWrite to the same pin does not work. Once I saw this report I changed my digitalWrite calls into analogWrite with values of 0 or 255 and my project is working properly. BTW: I have four analogWrite pins in use.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It looks like two bugs to me.
my not so beautiful workaround
void digitalWrite2(int pinnr , boolean pinhigh){
if (pinnr==LED_PWR) digitalWrite(LED_PWR, pinhigh);
else analogWrite(pinnr, 255*pinhigh);
}
void analogWrite2(int pinnr ,uint8_t value){
if (pinnr==LED_PWR) digitalWrite(pinnr,value>127);
else analogWrite(pinnr,value);
}
It would be better to solve it by redefining the functions itself but so that it still compiles for other boards.
The text was updated successfully, but these errors were encountered: