/*********************************************************************
This is an example sketch for our Monochrome Nokia 5110 LCD Displays
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/338
These displays use SPI to communicate, 4 or 5 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information
All text above, and the splash screen must be included in any redistribution
*********************************************************************/
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
#include <Wire.h>
#include <Adafruit_BMP085.h>
// pin 8 - Serial clock out (SCLK)
// pin 7 - Serial data out (DIN)
// pin 6 - Data/Command select (D/C)
// pin 5 - LCD chip select (CS)
// pin 4 - LCD reset (RST)
Adafruit_PCD8544 display = Adafruit_PCD8544(4, 5, 6, 7, 8);
#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH 16
const unsigned char PROGMEM logo16_glcd_bmp[] =
{ B00000000, B11000000,
B00000001, B11000000,
B00000001, B11000000,
B00000011, B11100000,
B11110011, B11100000,
B11111110, B11111000,
B01111110, B11111111,
B00110011, B10011111,
B00011111, B11111100,
B00001101, B01110000,
B00011011, B10100000,
B00111111, B11100000,
B00111111, B11110000,
B01111100, B11110000,
B01110000, B01110000,
B00000000, B00110000 };
//Собственное лого 80х25px
const unsigned char PROGMEM logo[] =
{
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,
B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,
B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000, B00100000, B01001000, B00000001, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000, B00100000, B01001000, B00000001, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000, B00100000, B01001000, B00000001, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000, B00100000, B01001000, B00000001, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000, B00100000, B01001000, B00000001, B00000000, B00000000,
B10100101, B01001010, B10010001, B10110110, B00110000, B11100011, B01001001, B00111001, B01100001, B01010010,
B10100101, B01001010, B10010010, B01011001, B01001001, B00100101, B01001010, B00101001, B10100001, B10010010,
B10110101, B01101010, B11010010, B01010001, B01001010, B00101110, B01001100, B00001001, B00100001, B10010010,
B10110101, B01101010, B11010010, B01010001, B01001010, B00101000, B01001110, B00111001, B00100001, B00010010,
B11011001, B10110011, B01100010, B01010010, B01001010, B01101100, B01001010, B00101001, B00100001, B00010110,
B01010000, B10100001, B01001001, B10011110, B00110001, B10110111, B01101001, B10111101, B00110101, B00011011,
B00000000, B00000000, B00000000, B00010000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000, B00010000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000, B00010000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000, B00010000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,
B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000,
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,
};
Adafruit_BMP085 bmp;
void setup() {
Serial.begin(9600);
if (!bmp.begin()) {
Serial.println("Could not find a valid BMP085 sensor, check wiring!");
while (1) {}
}
display.begin();
// init done
// you can change the contrast around to adapt the display
// for the best viewing!
display.setContrast(60);
display.display(); // show splashscreen
delay(2000);
display.clearDisplay();
// miniature bitmap display
display.clearDisplay();
// x, y, logo, w, h, color
// Координаты x и y
// Переменная с логотипом
// Ширина и высота
// Цвет 1=black
display.drawBitmap(display.width()/2-40, display.height()/2-14, logo, 80, 25, 1);
display.display();
delay(3000);
display.clearDisplay();
display.display();
}
void loop() {
display.setTextSize(1);
display.setTextColor(BLACK);
display.setCursor(0,0);
display.print("t = ");
display.print(bmp.readTemperature());
display.println(" *C");
display.print("P = ");
display.print(bmp.readPressure()/133.3);
display.println(" mm");
display.print("A = ");
display.print(bmp.readAltitude(103227));
display.println(" m");
display.setCursor(6,30);
display.print("opodelkah.ru");
display.display();
delay(500);
display.clearDisplay();
}