本文整理汇总了C++中LCDsendCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ LCDsendCommand函数的具体用法?C++ LCDsendCommand怎么用?C++ LCDsendCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LCDsendCommand函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LCDinit
void LCDinit(void)//Initializes LCD
{
_delay_ms(15);
LDP=0x00;
LCP=0x00;
LDDR|=1<<LCD_D7|1<<LCD_D6|1<<LCD_D5|1<<LCD_D4;
LCDR|=1<<LCD_E|1<<LCD_RW|1<<LCD_RS;
//---------one------
LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4; //4 bit mode
LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS;
_delay_ms(1);
LCP&=~(1<<LCD_E);
_delay_ms(1);
//-----------two-----------
LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4; //4 bit mode
LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS;
_delay_ms(1);
LCP&=~(1<<LCD_E);
_delay_ms(1);
//-------three-------------
LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|0<<LCD_D4; //4 bit mode
LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS;
_delay_ms(1);
LCP&=~(1<<LCD_E);
_delay_ms(1);
//--------4 bit--dual line---------------
LCDsendCommand(0b00101000);
//-----increment address, cursor shift------
LCDsendCommand(0b00001110);
}
示例2: LCDinit
void LCDinit(void) //Initializes LCD
{
_delay_ms(15);
//zero to data pins
LCDMix_4Bit(0b00000000);
//zero to control pins
LDPRS &= ~(1 << LCD_RS);
LDPRW &= ~(1 << LCD_RW);
LDPE &= ~(1 << LCD_E);
//set data direction
LDDD4 |= 1 << LCD_D4;
LDDD5 |= 1 << LCD_D5;
LDDD6 |= 1 << LCD_D6;
LDDD7 |= 1 << LCD_D7;
//control direction pins
LDDRS |= 1 << LCD_RS;
LDDRW |= 1 << LCD_RW;
LDDE |= 1 << LCD_E;
//---------one------
LCDMix_4Bit(0b00110000);
LDPE |= 1 << LCD_E;
_delay_ms(1);
LDPE &= ~(1 << LCD_E);
_delay_ms(1);
//-----------two-----------
LCDMix_4Bit(0b00110000);
LDPE |= 1 << LCD_E;
_delay_ms(1);
LDPE &= ~(1 << LCD_E);
_delay_ms(1);
//-------three-------------
LCDMix_4Bit(0b00100000);
LDPE |= 1 << LCD_E;
_delay_ms(1);
LDPE &= ~(1 << LCD_E);
_delay_ms(1);
//--------4 bit--dual line---------------
LCDsendCommand(0b00101000);
//-----increment address, invisible cursor shift------
LCDsendCommand(0b00001100);
}
示例3: LCDcursorRight
//Moves cursor by n poisitions left
void LCDcursorRight(uint8_t n)
{
for (uint8_t i=0;i<n;i++)
{
LCDsendCommand(0x14);
}
}
示例4: LCDcursorLeft
void LCDcursorLeft(uint8_t n) //Moves cursor by n positions left
{
for(uint8_t i = 0; i < n; i++)
{
LCDsendCommand(0x10);
}
}
示例5: LCDGotoXY
void LCDGotoXY(uint8_t x, uint8_t y) //Cursor to X Y position
{
register uint8_t DDRAMAddr;
// remap lines into proper order
switch(y)
{
case 0:
DDRAMAddr = LCD_LINE0_DDRAMADDR+x;
break;
case 1:
DDRAMAddr = LCD_LINE1_DDRAMADDR+x;
break;
case 2:
DDRAMAddr = LCD_LINE2_DDRAMADDR+x;
break;
case 3:
DDRAMAddr = LCD_LINE3_DDRAMADDR+x;
break;
default:
DDRAMAddr = LCD_LINE0_DDRAMADDR+x;
}
// set data address
LCDsendCommand(1<<LCD_DDRAM | DDRAMAddr);
}
示例6: LCDshiftRight
void LCDshiftRight(uint8_t n) //Scrol n of characters Left
{
for (uint8_t i=0;i<n;i++)
{
LCDsendCommand(0x18);
}
}
示例7: LCDcursorRight
void LCDcursorRight(uint8_t n) //Moves cursor by n poisitions left
{
for (uint8_t i=0;i<n;i++)
{
LCDsendCommand(0x14);
}
}
示例8: LCDcursorLeft
//Moves cursor by n poisitions left
void LCDcursorLeft(uint8_t n)
{
for (uint8_t i=0;i<n;i++)
{
LCDsendCommand(0x10);
}
}
示例9: LCDshiftLeft
void LCDshiftLeft(uint8_t n) //Scroll n of characters Right
{
for(uint8_t i = 0; i < n; i++)
{
LCDsendCommand(0x1E);
}
}
示例10: LCDshiftRight
//Scrol n of characters Left
void LCDshiftRight(uint8_t n)
{
uint8_t i;
for (i=0;i<n;i++)
{
LCDsendCommand(0x18);
}
}
示例11: LCDshiftLeft
//Scrol n of characters Right
void LCDshiftLeft(uint8_t n)
{
uint8_t i;
for (i=0;i<n;i++)
{
LCDsendCommand(0x1C);
}
}
示例12: LCDdefinechar
/*
const uint8_t backslash[] PROGMEM=
{
0b00000000,//back slash
0b00010000,
0b00001000,
0b00000100,
0b00000010,
0b00000001,
0b00000000,
0b00000000
};
LCDdefinechar(backslash,0);
*/
void LCDdefinechar(const uint8_t *pc,uint8_t char_code){
uint8_t a, pcc;
uint16_t i;
a=(char_code<<3)|0x40;
for (i=0; i<8; i++){
pcc=pgm_read_byte(&pc[i]);
LCDsendCommand(a++);
LCDsendChar(pcc);
}
}
示例13: LCDinit
//lcd init
void LCDinit()
{
//setup lcd pin
lcd_pin_setup();
//init lcd
_delay_ms(50);
bit_clear(LCD_RS_PORT, BIT(LCD_RS_BIT));
bit_clear(LCD_EN_PORT, BIT(LCD_EN_BIT));
bit_set(LCD_D4_PORT, BIT(LCD_D4_BIT));
bit_set(LCD_D5_PORT, BIT(LCD_D5_BIT));
LCDtoggleEn();
_delay_ms(10);
//LCD_PORT=0x30; //DB4 = DB5 = 1, RS = RW = 0
LCDtoggleEn();
_delay_ms(5);
//LCD_PORT=0x30; //DB4 = DB5 = 1, RS = RW = 0
LCDtoggleEn();
_delay_ms(5);
//LCD_PORT=0x20; //DB5 = 1, RS = RW = 0
bit_clear(LCD_D4_PORT, BIT(LCD_D4_BIT));
LCDtoggleEn();
_delay_ms(5);
//set setting
LCDsendCommand(0x28); //4bit 2line 5x7font
LCDsendCommand(0x0c); //display on cursor off
LCDsendCommand(0x06); //auto inc display shift off
LCDsendCommand(0x80); //cursor home
//init 8 custom chars
//uint8_t ch=0, chn=0;
//while(ch<64)
//{
//LCDdefinechar((LcdCustomChar+ch),chn++);
//ch=ch+8;
//}
LCDDefineProgressBarChar();
}
示例14: LCDclr
//Clears LCD
void LCDclr()
{
LCDsendCommand(1<<LCD_CLR);
}
示例15: LCDvisible
void LCDvisible(void) //Shows LCD
{
LCDsendCommand(0x0C);
}