marcoschwartz / aREST

A RESTful environment for Arduino
http://aREST.io/
Other
1.2k stars 279 forks source link

output pin set to low at startup #289

Open nicolapappagallo opened 4 years ago

nicolapappagallo commented 4 years ago

Testing arest with A Mega 2560 arduino and ethernet interface connected to homeassistant, i was wondering why the output switches were set up to LOW (ON) at startup. Reading the code i found that in arest.h there is // Output if (state == 'o') {

  // Set to Output
  pinMode(pin, OUTPUT);

digitalWrite(pin,HIGH);

that set directly LOW the pin state once set it as OUTPUT.

Modified in this way // Output if (state == 'o') {

  // Set to Output
  pinMode(pin, OUTPUT);

digitalWrite(pin,HIGH);

everything is ok.