Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //YWROBOT
- //Compatible with the Arduino IDE 1.0
- //Library version:1.1
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
- void setup()
- {
- lcd.init(); // initialize the lcd
- lcd.init();
- // Print a message to the LCD.
- lcd.backlight();
- }
- void loop()
- {
- int rx = analogRead(A0);
- int ry = analogRead(A1);
- int tempX, tempY,
- x = rx, br=0;
- if(tempX != rx) {
- lcd.setCursor(0,0);
- lcd.print("x=");
- lcd.print(rx);
- lcd.print(" ");
- tempX = rx;
- }
- if(tempY != ry) {
- lcd.setCursor(0,1);
- lcd.print("y=");
- lcd.print(ry);
- lcd.print(" ");
- tempY = ry;
- }
- delay(50);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement