Advertisement
Guest User

Untitled

a guest
Nov 19th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include <LiquidCrystal.h>
  2. LiquidCrystal lcd(11, 10, 9, 8, 7, 6);
  3. int reply;
  4. int switchStatemal = 0;
  5. int switchState1 = 0;
  6. int switchState2 = 0;
  7. int zwischenspeicher1;
  8. int zwischenspeicher2;
  9. int zwischenspeichermal;
  10. int taste1 = 1;
  11. int taste2 = 2;
  12. void setup() {
  13. lcd.begin(16, 2);
  14. pinMode(2, INPUT);
  15. pinMode(3, INPUT);
  16. pinMode(5, INPUT);
  17.  
  18.  
  19. }
  20.  
  21. void loop() {
  22. switchStatemal = digitalRead(2);
  23. switchState1 = digitalRead(3);
  24. switchState2 = digitalRead(4);
  25. if (switchStatemal == HIGH) {
  26. zwischenspeichermal = 1;
  27. }
  28. else if (switchState1 == HIGH) {
  29. zwischenspeicher1 = 1;
  30. }
  31. else if (switchState2 == HIGH) {
  32. zwischenspeicher2 = 1;
  33. }
  34. if (zwischenspeicher1 = 1 && zwischenspeicher2 = 1 && zwischenspeichermal = 1) {
  35. lcd.print(taste1 * taste2);
  36. }
  37. else if && zwischenspeicher2 = 1 && (zwischenspeichermal = 0 {
  38. lcd.print(taste1 + taste2);
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement