LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Boot state of digital lines for Mega 2560 R3

Hi All,

I'm working on a project that will have a Mega 2560 control a lot of solenoid valves and some high voltage power supplies. I've notcied that the default boot state of the 2560 with the LVIFA firmware on it leaves digital pins 3,4,5,11,12,21 set to high when the Arduino boots (the rest are set to LOW). This is really undesirable... especially given the high voltage.. Does anyone know what is causing this and how to disable it so that the pins are all defaulting to LOW? I have tried placing the following snippet into the setup():

  // Place your custom setup code here

   

  for (int thisPin = 2; thisPin = 53; thisPin ++){

    pinMode(thisPin, OUTPUT);

    digitalWrite(thisPin, LOW);

  }

but this does not work..

Thanks!

0 Kudos
Message 1 of 4
(4,195 Views)

I would recommend that you see what happens when you don't use LIFA and use a simple sketch on the Arduino.  If they still don't all default to low then I would guess that it's in the microprocessor.  If you ask in the Arduino forums, they might already know the answer.

0 Kudos
Message 2 of 4
(3,067 Views)

   Hi nebramall

          I had the same issue when interfacing Labview and the 2560 Rev3, and I solve it just adding a write vi at the end of my while loop that sets all outputs to low value, if I don't do that, the pin outputs will keep at the last value they had, if you are using only the Arduino sketch, you should try to do the same when you stop the program.

     Regards

Pedro

0 Kudos
Message 3 of 4
(3,067 Views)