Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

analogWrite to LED_PWR and digitalWrite after analogWrite #76

Open
@FemmeVerbeek

Description

@FemmeVerbeek

It looks like two bugs to me.

  • analogWrite to LED_PWR hangs up the program
  • digitalWrite to any pin stops working after being preceded by a call to analogWrite to the same pin.

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.

  • Is there an #ifdef compiler directive to check that we are compiling for this type of board.
  • while redefining, how would you point back to the orginal funtions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions