Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Connections should be made as follows
- Pin Pin
- Gnd --> 2
- 5v --> 3
- 10 --> 4
- 11 --> 5
- 12 --> 6
- 13 --> 7
- */
- void setup() {
- Serial.begin(9600);
- pinMode(10, OUTPUT);
- pinMode(11, OUTPUT);
- pinMode(12, OUTPUT);
- pinMode(13, OUTPUT);
- pinMode(7, INPUT);
- pinMode(6, INPUT);
- pinMode(5, INPUT);
- pinMode(4, INPUT);
- pinMode(3, INPUT);
- pinMode(2, INPUT_PULLUP);
- }
- void loop() {
- digitalWrite(10, HIGH);
- if (digitalRead(4) == LOW) {
- Serial.println("Check the wire going from pin 10 to 4")
- }
- digitalWrite(10, LOW);
- digitalWrite(11, HIGH);
- if (digitalRead(5) == LOW) {
- Serial.println("Check the wire going from pin 11 to 5")
- }
- digitalWrite(11, LOW);
- digitalWrite(12, HIGH);
- if (digitalRead(6) == LOW) {
- Serial.println("Check the wire going from pin 12 to 6")
- }
- digitalWrite(12, LOW);
- digitalWrite(13, HIGH);
- if (digitalRead(7) == LOW) {
- Serial.println("Check the wire going from pin 13 to 7")
- }
- digitalWrite(13, LOW);
- if (digitalRead(3) == LOW) {
- Serial.println("Check the wire going from 5v to pin 3")
- }
- if (digitalRead(2) == HIGH) {
- Serial.println("Check the wire going from GND to pin 2")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement