Tell us about yourself!

Complete Your Profile
  • Magic Light (Capacitance Sensor, First Arduino Project)

    Can u explain this code:"for (i=0; i < 4 ; i++ ){ // do it four times to build up an average - not really neccessary but takes out some jitter // LOW-to-HIGH transition PORTB = PORTB | 1; // Same as line below - shows programmer chops but doesn't really buy any more speed // digitalWrite(8, HIGH); // output pin is PortB0 (Arduino , sensor pin is PortB1 (Arduinio 9) while ((PINB & B10) != B10 ) { // while the sense pin is not high // while (digitalRead(9) != 1) // same as above port manipulation above - only 20 times slower! x++; } delay(1); // HIGH-to-LOW transition PORTB = PORTB & 0xFE; // Same as line below - these shows programmer chops but doesn't really buy any more speed //digitalWrite(8, LOW); while((PINB & B10) != 0 ){ // while pin is not low ...

    see more »

    Can u explain this code:"for (i=0; i < 4 ; i++ ){ // do it four times to build up an average - not really neccessary but takes out some jitter // LOW-to-HIGH transition PORTB = PORTB | 1; // Same as line below - shows programmer chops but doesn't really buy any more speed // digitalWrite(8, HIGH); // output pin is PortB0 (Arduino , sensor pin is PortB1 (Arduinio 9) while ((PINB & B10) != B10 ) { // while the sense pin is not high // while (digitalRead(9) != 1) // same as above port manipulation above - only 20 times slower! x++; } delay(1); // HIGH-to-LOW transition PORTB = PORTB & 0xFE; // Same as line below - these shows programmer chops but doesn't really buy any more speed //digitalWrite(8, LOW); while((PINB & B10) != 0 ){ // while pin is not low -- same as below only 20 times faster // while(digitalRead(9) != 0 ) // same as above port manipulation - only 20 times slower! y++; } delay(1); }"

    View Instructable »