SHARE
TWEET

Test Photo Sensor

sweenig Mar 26th, 2014 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup()
  2. {
  3.   Serial.begin(115200);
  4.   while(!Serial.available()) SPARK_WLAN_Loop(); // Open terminal and press ENTER
  5.   Serial.println("Reading...");
  6.   pinMode(D2, INPUT);
  7.   pinMode(D3, INPUT);
  8.   pinMode(D4, INPUT);
  9.   pinMode(A6, INPUT);
  10.   pinMode(A7, INPUT);
  11.  
  12. }
  13.  
  14. void loop()
  15. {
  16.     Serial.print("D2: ");Serial.println(digitalRead(D2));
  17.     Serial.print("D3: ");Serial.println(digitalRead(D3));
  18.     Serial.print("D4: ");Serial.println(digitalRead(D4));
  19.     Serial.print("A6: ");Serial.println(digitalRead(A6));
  20.     Serial.print("A7: ");Serial.println(digitalRead(A7));
  21.     Serial.println("====================");
  22.     delay(1000);
  23. }
RAW Paste Data
Top