IFD:GrundlagenElektronik2011/Project/Code: Difference between revisions

From Medien Wiki
No edit summary
m (bitte syntaxhighlight für code verwenden!)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  int istheButton = 2;  
<syntaxhighlight lang="cpp">
int istheButton = 2;  
   int theMotoris  = 13;   
   int theMotoris  = 13;   
   int theStatusis = 1;
   int theStatusis = 1;
Line 15: Line 16:
   } else digitalWrite(theMotoris, LOW);
   } else digitalWrite(theMotoris, LOW);
    
    
   //place for thoughts.
   //place for thoughts like it's not then perfect if you cannot add something anymore it is if you cannot leave something out.
 
   }
   }
</syntaxhighlight>
=Circuit=
[[File:PHCircuit.png|520px|Circuit]]


[[File:PHCircuit.png|130px|Circuit]]


<small> Es ist nicht dann perfekt, wenn man noch etwas hinzufügen könnte, es ist erst dann perfekt, wenn man nichts mehr weglassen kann!</small>
<small>Original file created with Fritzing.
Sendable via [[User:Hier|E-Mail]] if wished. </small>

Latest revision as of 18:32, 19 August 2012

int istheButton = 2; 
  int theMotoris  = 13;   
  int theStatusis = 1;

  void setup() {
  pinMode(theMotoris, OUTPUT);      
  pinMode(istheButton, INPUT );     
  }
  void loop(){
  
  theStatusis = digitalRead(istheButton);
  if (theStatusis == HIGH) {     
   digitalWrite(theMotoris, HIGH);
    delay (5000);
  } else digitalWrite(theMotoris, LOW);
  
  //place for thoughts like it's not then perfect if you cannot add something anymore it is if you cannot leave something out.
  
  }

Circuit

Circuit


Original file created with Fritzing. Sendable via E-Mail if wished.