Added a DEM16101 lcd display to the shift register
This commit is contained in:
parent
38b63ddbdd
commit
86df456b0f
@ -1 +1 @@
|
|||||||
Subproject commit 9f8ad3372382536275926cd95d5e5343235faf21
|
Subproject commit d9ac375268cb6bfa03a16b803b4d11ef9531dd3a
|
38
MyLcd.cpp
Normal file
38
MyLcd.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#include "MyLcd.h"
|
||||||
|
#include "Hardware.h"
|
||||||
|
|
||||||
|
void MyLcd::execute(const Command &cmd, bool RS, double delay)
|
||||||
|
{
|
||||||
|
static const uint8_t eMask = 0b00000010;
|
||||||
|
static const uint8_t rsMask = 0b01000000;
|
||||||
|
//static const double pulseLength = 0.5;
|
||||||
|
|
||||||
|
{
|
||||||
|
uint8_t output = (cmd.data & 0xf0) >> 2;
|
||||||
|
if (RS)
|
||||||
|
{
|
||||||
|
output |= rsMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_lcdShiftReg.set(output | eMask);
|
||||||
|
//delay_us(pulseLength);
|
||||||
|
m_lcdShiftReg.set(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
uint8_t output = (cmd.data & 0x0f) << 2;
|
||||||
|
if (RS)
|
||||||
|
{
|
||||||
|
output |= rsMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_lcdShiftReg.set(output | eMask);
|
||||||
|
//delay_us(pulseLength);
|
||||||
|
m_lcdShiftReg.set(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
delay_ms(delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user