Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <Adafruit_ADS1015.h>
  2. #include <Wire.h>
  3. #include <LiquidCrystal_I2C.h>
  4.  
  5. LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
  6. Adafruit_ADS1115 ads1115 (0x48);
  7.  
  8.  
  9. void setup() {
  10. Serial.begin(9600);
  11. lcd.begin(16,2);
  12. ads1115.begin();
  13.  
  14. ; }
  15.  
  16. void loop() {
  17. int16_t results;
  18. results = ads1115.readADC_Differential_0_1();
  19. lcd.setCursor(0,0);
  20. lcd.print("Salinity:");
  21. lcd.setCursor(0,1);
  22. lcd.print(results);
  23. delay(50); //delay before looping'
  24. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement