move stuff
This commit is contained in:
		
							parent
							
								
									cc49225717
								
							
						
					
					
						commit
						3f524bc360
					
				
					 6 changed files with 0 additions and 0 deletions
				
			
		
							
								
								
									
										49
									
								
								projekte/lc-display/sketch_sep29a/sketch_sep29a.pde
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								projekte/lc-display/sketch_sep29a/sketch_sep29a.pde
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,49 @@
 | 
			
		|||
int pinA = 7;
 | 
			
		||||
int pinB = 8;
 | 
			
		||||
int pinLED = 13;
 | 
			
		||||
int pinLEDstate = LOW;
 | 
			
		||||
long prevMillis = 0;
 | 
			
		||||
 | 
			
		||||
void setup() {
 | 
			
		||||
  Serial.begin(9600);
 | 
			
		||||
  pinMode(pinA, INPUT);
 | 
			
		||||
  digitalWrite(pinA, HIGH); 
 | 
			
		||||
  pinMode(pinB, INPUT);
 | 
			
		||||
  digitalWrite(pinB, HIGH); 
 | 
			
		||||
  pinMode(pinLED, OUTPUT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int a_old, b_old, dreh;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void loop() {
 | 
			
		||||
  // shall we blink
 | 
			
		||||
//  if (millis() - prevMillis > 100) {
 | 
			
		||||
//    prevMillis = millis();
 | 
			
		||||
//    
 | 
			
		||||
//    if (pinLEDstate == LOW) 
 | 
			
		||||
//      pinLEDstate = HIGH;
 | 
			
		||||
//    else 
 | 
			
		||||
//      pinLEDstate = LOW;
 | 
			
		||||
//    digitalWrite(pinLED, pinLEDstate);
 | 
			
		||||
//    
 | 
			
		||||
  int a = digitalRead(pinA);
 | 
			
		||||
  int b = digitalRead(pinB);
 | 
			
		||||
 | 
			
		||||
  if (a != a_old || b != b_old) {
 | 
			
		||||
    Serial.print(digitalRead(pinA));
 | 
			
		||||
    Serial.print(" ");
 | 
			
		||||
    Serial.print(digitalRead(pinB));
 | 
			
		||||
    Serial.println();
 | 
			
		||||
    dreh++;
 | 
			
		||||
    // Serial.println("C:> _");
 | 
			
		||||
  } else {
 | 
			
		||||
    if (dreh%2 == 0) {
 | 
			
		||||
      Serial.println();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  digitalWrite(pinLED, a);
 | 
			
		||||
  a_old = a; b_old = b;
 | 
			
		||||
}
 | 
			
		||||
		Reference in a new issue