I am seeing strange behaviour on my Portenta Machine Control unit. When I write 0 to all analog outputs, 0,1, and 3 drive 0 V, but analog output 2 drives 10 V. Analog output 2 drives 0.1 V when I write 0.1 V to it. I have duplicated the behaviour on a second identical unit.
A minimal working example is below.
- Arduino CLI version 0.20.2
- MBED Portenta Core version 2.6.1
- Arduino Machine Control library version 1.0.2.
- I have not updated the library to 1.1.0 because there have been no material changes to the AnalogOut class.
- Uploading this for the M7 core.
#include <Arduino_MachineControl.h>
using namespace machinecontrol;
void setup()
{
Serial.begin(9600);
while (!Serial)
;
analog_out.period_ms(0, 4);
analog_out.period_ms(1, 4);
analog_out.period_ms(2, 4);
analog_out.period_ms(3, 4);
Serial.println("Analog out test");
}
void loop()
{
for (int i = 0; i < 4; ++i)
{
analog_out.write(i, 0);
}
delay(100);
}
Has anyone experienced the same issue? Any suggestions? Thanks in advance!