Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iothings:proiecte:2025sric:windowopener [2025/04/23 13:42]
matei.neaga [Software]
iothings:proiecte:2025sric:windowopener [2025/05/18 18:18] (current)
matei.neaga [Window opener, based on gas detection]
Line 11: Line 11:
 ====== Context ====== ====== Context ======
  
 +Block diagram of the project
 +
 +{{ :​iothings:​proiecte:​2025sric:​block-diagram-neaga-matei.png |}}
 +
 +Flowchart of the project
 +
 +{{ :​iothings:​proiecte:​2025sric:​flowchart-neaga-matei.png |}}
  
  
Line 43: Line 50:
  
 Servo myservo; Servo myservo;
 +</​code>​
 +
 +<code cpp>
 +void loop() {
 +  server.handleClient();​
 +  ​
 +  ​
 +  valoare_analogica = analogRead(ANALOG_PIN);​
 +  ​
 +  ​
 +  if (modAutomat) {
 +    if (valoare_analogica >= pragActivare && !servoActiv) {
 +      activeazaServo();​
 +    } else if (valoare_analogica < pragActivare && servoActiv) {
 +      dezactiveazaServo();​
 +    }
 +  }
 +  ​
 +  delay(100); ​
 +}
 +
 +// Funcție pentru activarea servomotorului
 +void activeazaServo() {
 +  myservo.write(90); ​
 +  servoActiv = true;
 +  Serial.println("​Servo activat!"​);​
 +}
 +
 +// Funcție pentru dezactivarea servomotorului
 +void dezactiveazaServo() {
 +  myservo.write(0); ​
 +  servoActiv = false;
 +  Serial.println("​Servo dezactivat!"​);​
 +}
 +
 </​code>​ </​code>​
  
iothings/proiecte/2025sric/windowopener.1745404946.txt.gz · Last modified: 2025/04/23 13:42 by matei.neaga
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0