arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.17k stars 7.02k forks source link

Arduino pins go high on boot and stay there #7017

Closed SkyFoxGR closed 6 years ago

SkyFoxGR commented 6 years ago

Arduino pins go high on boot and stay there I have set the pin on start up to be low but still they are high. Sometimes after I press more than 5 times the reset button it works but now it stop complete to work even 100 times. 2 different boards and 1 is new

int tim = 500 ; //einai to diastima pou mesolavei gia na anapci to ena fos meta to allo 500ms0
int tim1 = 1000 ; //einai to diastima pou mesolavei gia na kinithi to ena svisto fos  500ms
int tim2 = 1000 ; //einai to rithmos svisimatos apo to kaintro  500ms
int timm = 6; //10 defterolepta * 6= 60 deuterolepta  //einai i diarkia pou paramenoun anamena xoris na perasi amaxi se ms
int tim3 = 15000 ;

int con1 = 16; //10 defterolepta * 6= 60 deuterolepta  //einai i diarkia pou paramenoun anamena xoris na perasi amaxi se ms
int conn1 = 15000 ;

int con = 0;
int conn = 0 ;

int timm1 = 0;
long tim4 = 240000 ;
int tt = 10;  //
int ttt = 11; //
int tt1 = 13;  //
int ttt1 = 12; //
int AAA = A1; //
int led1 =  A0;
int led2 =  2;
int led3 =  3;
int led4 =  4;
int led5 =  5;
int led6 =  6;
int led7 =  7;
int led8 =  8;
int led9 =  9;
int buttonState = LOW;
int buttonState1 = LOW  ;
boolean mm = false;
int coun = 0 ;

boolean sta = false;
boolean sta1 = false;
boolean sta2 = false;
boolean sta3 = false;
boolean sta4 = false;
boolean sta5 = false;
boolean sta6 = false;
boolean sta7 = false;

int ll = 0;
int lll = 0;
int ll1 = 0;
int lll1 = 0;
void setup() {
  pinMode(tt, OUTPUT);
  pinMode(ttt, OUTPUT);
  pinMode(tt1, OUTPUT);
  pinMode(ttt1, OUTPUT);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
  pinMode(led6, OUTPUT);
  pinMode(led7, OUTPUT);
  pinMode(led8, OUTPUT);
  pinMode(led9, OUTPUT);
  pinMode(AAA, INPUT);
  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  digitalWrite(led3, LOW);
  digitalWrite(led4, LOW);
  digitalWrite(led5, LOW);
  digitalWrite(led6, LOW);
  digitalWrite(led7, LOW);
  digitalWrite(led8, LOW);
  digitalWrite(led9, LOW);
}
liamkinne commented 6 years ago

Few questions:

SkyFoxGR commented 6 years ago

led1 - led9 led1 - led9 give power to soild state relays and then to lamps. those lamps stay high forever. if i start the program then is working fine but if the program go in standby mode and become idle then after 7 sec the lamps go from low to high themselves. Sometimes after I press more than 5 times the reset button it works but now it stop complete to work even 100 times. for test i have put on extreamly simple program and it have work perfectly. is like the booting system have gone complete rogue(void setup).

liamkinne commented 6 years ago

Sounds like it is to do with the circuit that you have and not the code.

Here is a page that details why your solid state relays aren't turning off: http://www.omron.com.au/service_support/FAQ/FAQ02155/index.asp

If that page doesn't give you answers, attach an image or diagram of your circuit and I might be able to spot any problems.

per1234 commented 6 years ago

This issue tracker is only to be used to report bugs or feature requests. This topic is more appropriate for the Arduino Forum. I'm sure we'll be able to help you with your problem over there.

Please do this:

  1. Read http://forum.arduino.cc/index.php?topic=148850
  2. If you haven't already done so, create a new thread in the appropriate section of the forum (http://forum.arduino.cc/), following all the rules. Be sure to post your code, using code tags (</> button on the toolbar).