Activity Forums Questions & Troubleshooting Software & Firmware Is there something wrong with my Controllino?

  • Is there something wrong with my Controllino?

     Lucko updated 3 years, 8 months ago 2 Members · 6 Posts
  • Lucko

    Member
    February 3, 2021 at 12:18 pm

    Problem is from Porting Arduino code…(https://community.controllino.com/forums/discussion/porting-arduino-code/) that I posted but it looks like you only get one replay and then none reads it anymore.

    I can’t make my Controllino to use analog outputs… I attempted even this code to troubleshoot:

    #include <Controllino.h>

    int outputPin = CONTROLLINO_AO0;

    int testPin = A0;

    void setup() {

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

    pinMode(outputPin, OUTPUT);

    pinMode(outputPin, CONTROLLINO_AO1);

    pinMode(testPin, INPUT);

    analogWrite(CONTROLLINO_AO1, 1);

    analogWrite(CONTROLLINO_AO1, 1);

    }

    void loop() {

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

    if (digitalRead(testPin)){

    analogWrite(outputPin, 255);

    analogWrite(CONTROLLINO_AO1, 255);

    }

    if (!(digitalRead(testPin))){

    analogWrite(outputPin, 1);

    analogWrite(CONTROLLINO_AO1, 1);

    }

    }

    then this…

    #include <Controllino.h>

    int outputPin = 12;

    int testPin = A0;

    void setup() {

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

    pinMode(outputPin, OUTPUT);

    pinMode(outputPin, 13);

    pinMode(testPin, INPUT);

    analogWrite(outputPin, 1);

    analogWrite(13, 1);

    }

    void loop() {

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

    if (digitalRead(testPin)){

    analogWrite(outputPin, 255);

    analogWrite(13, 255);

    }

    if (!(digitalRead(testPin))){

    analogWrite(outputPin, 1);

    analogWrite(13, 1);

    }

    }

    And it is not working. It is turning DI2 and DI3 on… AO0 is on 1.12V always and AO1 is 0V always… But DI2 and DI3 are changeing from 0 to 5V…

    And for some reasen I get an error if I use 0 in analogWrite(13, 1) but can use analogWrite(outputPin, 0)… I find that strange…

    I’m at a point thinking there is something wrong with my Controllino… Am I right?

    Porting Arduino code…

  • Lucko

    Member
    February 15, 2021 at 1:29 pm

    I copy/pased old code with a bug… This two part were fixed…

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

    pinMode(outputPin, OUTPUT);

    pinMode(CONTROLLINO_AO1, OUTPUT);

    pinMode(testPin, INPUT);

    analogWrite(outputPin, 1);

    analogWrite(CONTROLLINO_AO1, 1);

    And

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

    pinMode(outputPin, OUTPUT);

    pinMode(13, OUTPUT);

    pinMode(testPin, INPUT);

    analogWrite(outputPin, 1);

    analogWrite(13, 1);

  • Lukas

    Member
    February 16, 2021 at 12:32 pm

    Hello Lucko,

    I am sorry for a late reply. I have tested your code (also placed below in my comment) with my CONTROLLINO MAXI Automation and it works fine and as expected.

    • MAXI is powered from 24VDC
    • I measure 0,04 V at AO0
    • When I connect 24 V to AI0 then only AI0 LED is ON
    • And I can measure 10,09 V at AO0

    Please note that I can use value 0 for analogWrite without any problems.

    So, maybe there is really something wrong with your device, but it may be also something with your compilation toolchain … please share with us the verbose output of the compilation when you observe the issue with the value 0.

    #include <Controllino.h>
    int outputPin = 12;
    int testPin = A0;
    void setup() {
    // put your setup code here, to run once:
    pinMode(outputPin, OUTPUT);
    pinMode(13, OUTPUT);
    pinMode(testPin, INPUT);
    analogWrite(outputPin, 0);
    analogWrite(13, 0);
    }
    void loop() {
    // put your main code here, to run repeatedly:
    if (digitalRead(testPin)){
    analogWrite(outputPin, 255);
    analogWrite(13, 255);
    }
    if (!(digitalRead(testPin))){
    analogWrite(outputPin, 1);
    analogWrite(13, 1);
    }
    }

    Thanks,

    Lukas

    • Lucko

      Member
      February 17, 2021 at 8:43 am

      Hi!

      At the moment I can use 0 too. No idea what was wrong before. It might be a bug that we had and fixed… So I’m guessing it was me not setting pinMode… I’m more then happy to give you any additional data or screenshots if you need it it or run any program on a unit…

      Regards

      • This reply was modified 3 years, 9 months ago by  Lucko.
      • Lukas

        Member
        February 23, 2021 at 9:25 am

        Hi Lucko,

        please share with us your test setup wiring – a drawing or photo will be great!

        Thanks,

        Lukas

        • Lucko

          Member
          March 2, 2021 at 9:03 am

          You got them over the mail… You stopped answering to mails again(web form and “massaging app” on your page) so this is my last attempt before I will ask for my money back and find a different solution.

Viewing 1 - 3 of 3 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now