SHARE
TWEET

dupa

a guest May 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <LiquidCrystal.h>
  2. LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
  3. int buttonStatus;
  4.  
  5. void setup() {
  6.   pinMode(8, OUTPUT);
  7.   pinMode(13, INPUT_PULLUP);
  8.   pinMode(A0, INPUT);
  9.   pinMode(A1, INPUT);
  10.   Serial.begin(9600);
  11.   lcd.begin(16, 2);
  12.   lcd.setCursor(0, 0);
  13.   lcd.print("Hello");
  14.   lcd.setCursor(0, 1);
  15.   lcd.print("World!");
  16. }
  17.  
  18. void loop() {
  19.   Serial.print("Ruch po x: ");
  20.   Serial.println(analogRead(A0));
  21.   Serial.print("Ruch po y: ");
  22.   Serial.println(analogRead(A1));
  23.   Serial.print("Moj przelacznik: ");
  24.   Serial.println(digitalRead(13));
  25.   buttonStatus = digitalRead(13);
  26.   if (buttonStatus == 0) {
  27.      digitalWrite(8, HIGH);
  28.   }
  29.   else {
  30.     digitalWrite(8, LOW);
  31.   }
  32.   delay(100);
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top