-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pappu #1027
Comments
#include <EEPROM.h> #define stop A0//0push #define bling 10//mode #define bazar 8 //bazar int re1 = 0,re2 = 0,re3 = 0,time=0; int Load = 0, Mode=0; void setup() { digitalWrite(moter,LOW); digitalWrite(moter,LOW); pinMode(off, INPUT_PULLUP); pinMode(value, INPUT_PULLUP); re2 = EEPROM.read(12); if (EEPROM.read(0) == 0) { de_write(); count_write(); int value = analogRead(A5); if (digitalRead(stop) == 0) { delay(300); digitalWrite(bling,LOW); digitalWrite(dipar,LOW); digitalWrite(r3,0); EEPROM.write(13,0); delay(200); if (hh == 0) { hh = 1; Mode = !Mode; EEPROM.write(1, Mode); delay(100); } } else { digitalWrite(Relay1, HIGH); //LOWshuru if(timer<60){timer=timer+1; if(timer<50){ bt.print(value); //send bt.print(";"); digitalWrite(dipar, HIGH); bt.print(timer); bt.print(";"); } if(timer==2){ digitalWrite(r1,0); EEPROM.write(11,0); digitalWrite(r3,0); EEPROM.write(12,0); } delay(500); if(timer==60){ digitalWrite(dipar,LOW); bt.print(value); //send bt.print(";"); timer=58; if (value<values) { if(time<20){time=time+1; delay(200); if(time==1) { digitalWrite(bazar, HIGH); } if(time==20){ digitalWrite(bazar, LOW); } } delay(2000); digitalWrite(moter, HIGH); digitalWrite(r3,0); EEPROM.write(13,0); } else if(value<310){ digitalWrite(bazar, LOW); else if(value<0){ if(time<20){time=time+1; delay(200); if(time==1) { digitalWrite(bazar, HIGH); } if(time==20){ digitalWrite(bazar, LOW); } } digitalWrite(bazar, LOW); digitalWrite(moter,HIGH); } Serial.println(value); } } while (Serial.available()) { delay(10); char c = Serial.read(); inputs += c; if (inputs.length() > 0) { Serial.println(inputs); if(inputs == "@") { values=values+1; delay(200); values_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(values); bt.print(";"); } } else if(inputs == "&") { values=values-1; delay(200); values_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(values); bt.print(";"); } else if(inputs == "X") { sete=sete+1; for(int t=1;t<=5;t++){ delay(100); } else if(inputs == "x") { sete=sete-1; sete_write(); for(int t=1;t<=5;t++){ delay(100); else if(inputs == "E") { digitalWrite(r1,0); EEPROM.write(11,0); digitalWrite(bling,HIGH); } else if(inputs == "S") { sete=0; values=10; sete_write(); values_write(); for(int t=1;t<=10;t++){ delay(100); bt.print(values); bt.print(";"); bt.print(sete); bt.print(";"); } } inputs = ""; } } //LOWpaste } else { digitalWrite(Relay1, LOW); //highshuru if (digitalRead(Send) == 0) { digitalWrite(dipar, HIGH); delay(400); digitalWrite(dipar, LOW); delay(400); count = count + 1; count_write(); if(timer<60){timer=timer+1; if(timer==2) { delay(100); digitalWrite(r1,0); digitalWrite(r3,0); } bt.print(value); //send bt.print(";"); if(timer<50){ bt.print(timer); bt.print(";"); } if(timer==60){ digitalWrite(r1,0); digitalWrite(r3,0); timer=58; if (value<values) { if(time<20){time=time+1; delay(200); if(time==1) { digitalWrite(bazar, HIGH); } if(time==20){ digitalWrite(bazar, LOW); } } digitalWrite(moter, HIGH); digitalWrite(r3,0); EEPROM.write(13,0); } else if(value<310){ digitalWrite(bazar, LOW); digitalWrite(moter, LOW); } else if(value<0){ if(time<20){time=time+1; delay(200); if(time==1) { digitalWrite(bazar, HIGH); } if(time==20){ digitalWrite(bazar, LOW); } } digitalWrite(bazar, LOW); digitalWrite(moter,HIGH); } } } bt.print(count); bt.print(";"); if (count > de) { digitalWrite(bling,HIGH); count = 0; count_write(); digitalWrite(bazar, HIGH); delay(1000); digitalWrite(r1, 1);//offrelay digitalWrite(r2, 0); digitalWrite(r3,0); digitalWrite(bazar, LOW); } } if(digitalRead(start)==0){ digitalWrite(r2,1); } else{ delay(200); digitalWrite(bazar,LOW); } if(digitalRead(on)==0) { digitalWrite(bazar, HIGH); timer=0; delay(200); count = 0; count_write(); digitalWrite(r1,0); EEPROM.write(11,0); digitalWrite(r3,1); EEPROM.write(13,0); digitalWrite(r2,1); EEPROM.write(12,0); delay(1000); digitalWrite(bazar,LOW); digitalWrite(r3,0); EEPROM.write(13,0); } if (digitalRead(off) == 0) { digitalWrite(bazar, HIGH); digitalWrite(r1, 1); EEPROM.write(11, 0); digitalWrite(r2, 0); EEPROM.write(12,0); delay(1000); digitalWrite(bazar, LOW); } //HIGHpaste while (Serial.available()) { delay(10); char c = Serial.read(); inputs += c; if (inputs.length() > 0) { Serial.println(inputs); if(inputs == "A") { digitalWrite(bazar, HIGH); timer=0; count=0; count_write(); digitalWrite(r1,0); digitalWrite(r2,1); //onrelay digitalWrite(r3,1); delay(2000); //only on digitalWrite(r3,0); delay(500); digitalWrite(bazar,LOW); } else if(inputs == "a") { digitalWrite(bazar, HIGH); digitalWrite(r1,1); digitalWrite(r3,0); digitalWrite(r2,0); //onrelay time delay(100); //only on delay(500); digitalWrite(bazar,LOW); } else if(inputs == "B") { digitalWrite(r2,1); //onrelay EEPROM.write(12,1); } else if(inputs == "b") { digitalWrite(r2, 0);//onrelay EEPROM.write(12,0); digitalWrite(r3,0); //onrelay EEPROM.write(13,0);//TIMER on } else if(inputs == "C") { digitalWrite(r1, 0);//offrelay EEPROM.write(11, 0); digitalWrite(r2,1); EEPROM.write(12,1); digitalWrite(r3,1); //onrelay EEPROM.write(13,1);//TIMER on } else if(inputs == "c") { //onlyoff digitalWrite(r1,1);//offrelay EEPROM.write(11, 1); digitalWrite(r2,0); EEPROM.write(12,0); digitalWrite(r3,0); EEPROM.write(13,0); } else if(inputs == "E") { digitalWrite(r1,0); EEPROM.write(11,0); digitalWrite(bling,HIGH); } else if(inputs == "Y") { digitalWrite(dipar, HIGH); delay(200); digitalWrite(dipar, LOW); delay(200); if(mm<10){mm=mm+1; if(mm==10){ digitalWrite(bazar,HIGH); delay(500); digitalWrite(bazar,LOW); mm=0; } } de=de +60; de_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(de); bt.print(";"); } Serial.println(de); Serial.println("+59 "); } else if(inputs == "y") { digitalWrite(dipar, HIGH); delay(200); digitalWrite(dipar, LOW); delay(200); if (de > 0) { if(mm<10){mm=mm+1; digitalWrite(bazar,HIGH); delay(500); digitalWrite(bazar,LOW); mm=0; } } de=de-60; de_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(de); bt.print(";"); } Serial.println(de); Serial.println("-60 "); } } else if(inputs == "W"){ de=60; de_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(de); bt.print(";"); } } else if(inputs == "@") { values=values+1; delay(200); values_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(values); bt.print(";"); } } else if(inputs == "&") { values=values-1; delay(200); values_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(values); bt.print(";"); } } else if(inputs == "X") { sete=sete+1; sete_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(sete); bt.print(";"); } Serial.println("+1 "); } else if(inputs == "x") { sete=sete-1; sete_write(); for(int t=1;t<=5;t++){ delay(100); bt.print(sete); bt.print(";"); } } else if(inputs == "S") { sete=0; values=10; sete_write(); values_write(); for(int t=1;t<=10;t++){ delay(100); bt.print(sete); bt.print(";"); bt.print(values); bt.print(";"); } } inputs = ""; } } } void de_write() { EEPROM.write(2, de % 10); void count_write() { EEPROM.write(6, count % 10); void values_write() { EEPROM.write(15, values % 10); void sete_write() { EEPROM.write(19, sete % 10); |
Ppp |
No description provided.
The text was updated successfully, but these errors were encountered: