Advertisement
j0h

encoder74ls147read

j0h
Nov 20th, 2021
1,097
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. const unsigned int b1 = 7;
  2. const unsigned int b2 = 6;
  3. const unsigned int b3 = 5;
  4. const unsigned int b4 = 4;
  5.  
  6.  
  7. void setup() {
  8.   // put your setup code here, to run once:
  9. Serial.begin(9600);
  10. pinMode(b1,INPUT);
  11. pinMode(b2,INPUT);
  12. pinMode(b3,INPUT);
  13. pinMode(b4,INPUT);
  14. }
  15.  
  16. void loop() {
  17. int a = digitalRead(b1);
  18. int b = digitalRead(b2);
  19. int c= digitalRead(b3);
  20. int d = digitalRead(b4);
  21. Serial.print(a);
  22. Serial.print(b);
  23. Serial.print(c);
  24. Serial.println(d);
  25. delay(500);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement