In this example we show how to tak e on eof our sensor examples and the LCD shield example and we will then display the sensor readings on the LCD.
We will take the BMP180 example – Linkit One and BMP180 example and the LCD shield example – Linkit One and an LCD Shield
Layout
In this layout the LCD shield is connected to the Linkit One and the BMP180 sensor is connected to the LCD shield
Code
You will need to add the Adafruit libraries
[codesyntax lang=”cpp”]
#include <LiquidCrystal.h> #include <Wire.h> #include <Adafruit_BMP085.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 4, 5, 6, 7); Adafruit_BMP085 bmp; void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); Serial.begin(9600); if (!bmp.begin()) { Serial.println("Could not find BMP180 or BMP085 sensor at 0x77"); while (1) {} } } void loop() { // set the cursor to column 0, line 0 lcd.setCursor(0, 0); lcd.print("Temperature = " ); lcd.print(bmp.readTemperature()); // set the cursor to column 0, line 1 lcd.setCursor(0, 1); lcd.print("Pressure = "); lcd.print(bmp.readPressure()); delay(5000); }
[/codesyntax]
Links
BMP180 Digital Barometric Pressure Sensor Module
1PCS LCD Keypad Shield LCD1602 LCD 1602 Module Display For Arduino blue screen