diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-10-29 23:33:50 +1100 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-10-29 23:33:50 +1100 |
commit | e7843dae1650cfaa31c39b4ba73aee8fa78f6fb5 (patch) | |
tree | 69fa56ac35a958abc0e0f1fb814eed70f7a7c471 /libraries/MultiLCD/SSD1289.cpp | |
parent | 3b54329b359c374da1dba7ceaedd11f65e951d20 (diff) | |
download | 2021-arduino-obd-e7843dae1650cfaa31c39b4ba73aee8fa78f6fb5.tar.gz 2021-arduino-obd-e7843dae1650cfaa31c39b4ba73aee8fa78f6fb5.tar.bz2 2021-arduino-obd-e7843dae1650cfaa31c39b4ba73aee8fa78f6fb5.zip |
Update MultiLCD library
Diffstat (limited to 'libraries/MultiLCD/SSD1289.cpp')
-rw-r--r-- | libraries/MultiLCD/SSD1289.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libraries/MultiLCD/SSD1289.cpp b/libraries/MultiLCD/SSD1289.cpp index f2aebed..0f57264 100644 --- a/libraries/MultiLCD/SSD1289.cpp +++ b/libraries/MultiLCD/SSD1289.cpp @@ -1,8 +1,8 @@ /************************************************************************* -* Arduino Text Display Library for Multiple LCDs +* Arduino Text & Bitmap Display Library for color LCDs * Distributed under GPL v2.0 -* Copyright (c) 2013 Stanley Huang <stanleyhuangyc@live.com> -* All rights reserved. +* Developed by Stanley Huang <stanleyhuangyc@gmail.com> +* For more information, please visit http://arduinodev.com *************************************************************************/ #include <Arduino.h> @@ -17,11 +17,7 @@ Define zone #define CS 57 #define RST 56 -#define T_CLK 55 -#define T_CS 60 -#define T_DIN 54 -#define T_DOUT 8 -#define T_IRQ 9 +#define PIN_BACKLIGHT 8 #define X_CONST 240 #define Y_CONST 320 @@ -130,6 +126,9 @@ void LCD_SSD1289::begin() sbi (P_CS, B_CS); clear(); + + pinMode(PIN_BACKLIGHT, OUTPUT); + digitalWrite(PIN_BACKLIGHT, HIGH); } void LCD_SSD1289::setXY(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) @@ -148,6 +147,11 @@ void LCD_SSD1289::setXY(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) LCD_Write_COM(0x22); } +void LCD_SSD1289::setBackLight(byte brightness) +{ + analogWrite(PIN_BACKLIGHT, brightness); +} + void LCD_SSD1289::Enable() { cbi(P_CS, B_CS); |