Exemplo n.º 1
0
#include <Adafruit_PCD8544.h>
#include "Fonts/FreeSansBold9pt7b.h"
#define FONT FreeSansBold9pt7b

///////////////////
#include "LcdGui.h"
#include "xct_logo.h"

///////////////////
// Software SPI (slower updates, more flexible pin options):
// pin 3 - Serial clock out (SCLK)
// pin 4 - Serial data out (DIN)
// pin 5 - Data/Command select (D/C)
// pin 6 - LCD chip select (CS)
// pin 7 - LCD reset (RST)
Adafruit_PCD8544 Lcd = Adafruit_PCD8544(3, 4, 5, 6, 7);

///////////////////
#define T_DIVSEC  1000L
#define T_MIN  60L
#define T_10MIN 10*T_MIN

///////////////////
void InitLcd() {
  // Set up the LCD, display logo
  Lcd.begin();
  Lcd.setContrast(LCD_CONTRAST);
  Lcd.clearDisplay();
  Lcd.drawXBitmap(0, 0, LOGO_NAME, LOGO_WIDTH, LOGO_HEIGHT, BLACK);
  Lcd.display(); // show splashscreen
  delay(1000);
Exemplo n.º 2
0
#include <Libraries/OneWire/OneWire.h>
#include <Libraries/DS18S20/ds18s20.h>
#include "user_interface.h"

#define DS_PIN 0

DS18S20 ReadTemp;
Timer procTimer;

// Software SPI (slower updates, more flexible pin options):
// pin 7 - Serial clock out (SCLK)
// pin 6 - Serial data out (DIN)
// pin 5 - Data/Command select (D/C)
// pin 4 - LCD chip select (CS)
// pin 3 - LCD reset (RST)
Adafruit_PCD8544 display = Adafruit_PCD8544(14, 13, 12, 5, 4);


static const char degr_symbl[5] = {0x00, 0x07, 0x05, 0x07, 0x00};

void displayTemps() {
    uint8_t a;

    if (!ReadTemp.MeasureStatus()) {
        display.clearDisplay();
        display.setCursor(0, 0);

        for (a = 0; a < ReadTemp.GetSensorsCount(); a++) {
            if (ReadTemp.IsValidTemperature(a)) {
                display.printf("T%d: %.2f %cC\n", a + 1, ReadTemp.GetCelsius(a), (char) 0x7f);
            }
Exemplo n.º 3
0
/*------------------------------------------------------------
This is the .cpp file for FLIP GLCD Library
This is the property of Frugal Labs Tech Solutions Pvt. Ltd.
Please refer lisence.txt for complete details.
-------------------------------------------------------------*/
#include "Arduino.h"
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_PCD8544.h"
#include "FlipGlcd.h"
Adafruit_PCD8544 display = Adafruit_PCD8544(4,5,6,7,8); //configure the GLCD pins
FlipGlcd::FlipGlcd()
{
  
}

void FlipGlcd::glcdInit()
{
  display.begin();
 /* static const unsigned char PROGMEM logo16_glcd_bmp[] =
  {
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111111, 0b11111111, 0b11111111, 0b11111111, // ################################
    0b11111110, 0b00000000, 0b00000000, 0b00001111, // #######                     ####
    0b11111100, 0b00000000, 0b00000000, 0b00001111, // ######                      ####
    0b11111000, 0b00000000, 0b00000000, 0b00001111, // #####                       ####
    0b11110000, 0b00000000, 0b00000000, 0b00001111, // ####                        ####
    0b11100000, 0b00000000, 0b00000000, 0b00001111, // ###                         ####