Skip to content

Commit

Permalink
DM: updated for new rev PCB
Browse files Browse the repository at this point in the history
  • Loading branch information
deanm1278 committed Oct 18, 2017
1 parent bcae737 commit b91a554
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions src/STEMMA_LiquidCrystal.cpp
Expand Up @@ -24,6 +24,17 @@
// can't assume that its in that state when a sketch starts (and the
// STEMMA_LiquidCrystal constructor is called).

#define SS_RS 8
#define SS_EN 9
#define SS_D0 10
#define SS_D1 11
#define SS_D2 14
#define SS_D3 15
#define SS_BLR 4
#define SS_BLG 7
#define SS_BLB 6
#define SS_CONTRAST 5

STEMMA_LiquidCrystal::STEMMA_LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
Expand Down Expand Up @@ -52,7 +63,7 @@ STEMMA_LiquidCrystal::STEMMA_LiquidCrystal(uint8_t rs, uint8_t enable,

STEMMA_LiquidCrystal::STEMMA_LiquidCrystal() : _ss()
{
init(1, 6, 255, 7, 8, 9, 10, 11, 0, 0, 0, 0);
init(1, SS_RS, 255, SS_EN, SS_D0, SS_D1, SS_D2, SS_D3, 0, 0, 0, 0);
}

//TODO: add PWM pins
Expand Down Expand Up @@ -84,11 +95,8 @@ void STEMMA_LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uin
void STEMMA_LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize, uint8_t i2c_addr) {
_ss.begin(i2c_addr);

_ss.pinModeBulk(0b1100, OUTPUT);
_ss.digitalWriteBulk(0b1100, LOW);

_ss.analogWrite(0, 125);
_ss.analogWrite(1, 125);
_ss.analogWrite(SS_BLB, 125);
_ss.analogWrite(SS_CONTRAST, 155);

if (lines > 1) {
_displayfunction |= LCD_2LINE;
Expand Down
2 changes: 1 addition & 1 deletion src/STEMMA_LiquidCrystal.h
Expand Up @@ -3,7 +3,7 @@

#include <inttypes.h>
#include "Print.h"
#include <seesaw.h>
#include <Adafruit_seesaw.h>

// commands
#define LCD_CLEARDISPLAY 0x01
Expand Down

0 comments on commit b91a554

Please sign in to comment.