hacker007:
If this problem cannot be overcome, how to exchange analogWrite and digitalWrite? The following does not work:
analogWrite does that anyway:
void analogWrite(uint8_t pin, int val)
{
pinMode(pin, OUTPUT);
if (val == 0)
{
digitalWrite(pin, LOW);
}
...