Advertisement
Guest User

AAAAAAAAAAAAA

a guest
Jun 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Connections should be made as follows
  2.   Pin      Pin
  3.   Gnd -->  2
  4.   5v  -->  3
  5.   10  -->  4
  6.   11  -->  5
  7.   12  -->  6
  8.   13  -->  7
  9. */
  10. void setup() {
  11.   Serial.begin(9600);
  12.   pinMode(10, OUTPUT);
  13.   pinMode(11, OUTPUT);
  14.   pinMode(12, OUTPUT);
  15.   pinMode(13, OUTPUT);
  16.   pinMode(7, INPUT);
  17.   pinMode(6, INPUT);
  18.   pinMode(5, INPUT);
  19.   pinMode(4, INPUT);
  20.   pinMode(3, INPUT);
  21.   pinMode(2, INPUT_PULLUP);
  22. }
  23.  
  24. void loop() {
  25.   digitalWrite(10, HIGH);
  26.   if (digitalRead(4) == LOW) {
  27.     Serial.println("Check the wire going from pin 10 to 4")
  28.   }
  29.   digitalWrite(10, LOW);
  30.  
  31.   digitalWrite(11, HIGH);
  32.   if (digitalRead(5) == LOW) {
  33.     Serial.println("Check the wire going from pin 11 to 5")
  34.   }
  35.   digitalWrite(11, LOW);
  36.  
  37.   digitalWrite(12, HIGH);
  38.   if (digitalRead(6) == LOW) {
  39.     Serial.println("Check the wire going from pin 12 to 6")
  40.   }
  41.   digitalWrite(12, LOW);
  42.  
  43.   digitalWrite(13, HIGH);
  44.   if (digitalRead(7) == LOW) {
  45.     Serial.println("Check the wire going from pin 13 to 7")
  46.   }
  47.   digitalWrite(13, LOW);
  48.  
  49.   if (digitalRead(3) == LOW) {
  50.     Serial.println("Check the wire going from 5v to pin 3")
  51.   }
  52.  
  53.   if (digitalRead(2) == HIGH) {
  54.     Serial.println("Check the wire going from GND to pin 2")
  55.   }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement