Activity › Forums › Questions & Troubleshooting › Software & Firmware › Is there something wrong with my Controllino? › Reply To: Is there something wrong with my Controllino?
-
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