IFD:GrundlagenElektronik2011/Project/Code

From Medien Wiki
< IFD:GrundlagenElektronik2011‎ | Project
Revision as of 05:21, 31 March 2012 by Hier (talk | contribs) (Created page with "int istheButton = 2; int theMotoris = 13; int theStatusis = 1; void setup() { pinMode(theMotoris, OUTPUT); pinMode(istheButton, INPUT ); } void loo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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);
 
 
 }

Es ist nicht dann perfekt, wenn man noch etwas hinzufügen könnte, es ist erst dann perfekt, wenn man nichts mehr weglassen kann!