Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1.  
  2. int liczbaBinarna;
  3. void setup() {
  4. Serial.begin(9600);//Uruchomienie komunikacji przez USART
  5. pinMode(12,INPUT_PULLUP);
  6. pinMode(11,INPUT_PULLUP);
  7. pinMode(10,INPUT_PULLUP);
  8.  
  9. }
  10.  
  11. void loop() {
  12. liczbaBinarna=0;
  13.  
  14. if(digitalRead(10)==LOW)
  15. {
  16. liczbaBinarna=liczbaBinarna+1;
  17. }
  18. if(digitalRead(11)==LOW)
  19. {
  20. liczbaBinarna=liczbaBinarna+2;
  21. }
  22. if(digitalRead(12)==LOW)
  23. {
  24. liczbaBinarna=liczbaBinarna+4;
  25. }
  26.  
  27. Serial.println(liczbaBinarna);//Wysyłamy zmierzone napięcie
  28. delay(200);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement