Activity Forums Questions & Troubleshooting Software & Firmware Porting Arduino code… Reply To: Porting Arduino code…

  • Lucko

    Member
    January 13, 2021 at 2:12 pm

    That did not work… And it was not D12 but DI2 that is activating… That should be 10… And now I’m running really simple test code… A0 is OK but 12 is not working…

    #include <Controllino.h>

    int outputPin = 12;

    int testPin = A0;

    void setup() {

    // put your setup code here, to run once:

    pinMode(testPin, INPUT);

    analogWrite(outputPin, 0);

    }

    void loop() {

    // put your main code here, to run repeatedly:

    if (digitalRead(testPin)){

    analogWrite(outputPin, 255);

    }

    if (!(digitalRead(testPin))){

    analogWrite(outputPin, 0);

    }

    }

    • This reply was modified 1 month, 2 weeks ago by  Lucko.