Esempio n. 1
0
File: lcd.c Progetto: ntaormina/Lab4
void LCD_write_4(char byteToSend)
{
    unsigned char sendByte = byteToSend;

    sendByte &= 0x0F;

    sendByte |= LCDCON;

    sendByte &= 0x7f;

    SPI_send(sendByte);

    delayMilli();

    sendByte |= 0x80;

    SPI_send(sendByte);

    delayMilli();

    sendByte &= 0x7F;

    SPI_send(sendByte);

    delayMilli();
}
Esempio n. 2
0
File: lcd.c Progetto: ntaormina/Lab4
void LCDinit()
{
    writeCommandNibble(0x03);

    writeCommandNibble(0x03);

    writeCommandNibble(0x03);

    writeCommandNibble(0x02);

    writeCommandByte(0x28);

    writeCommandByte(0x0C);

    writeCommandByte(0x01);

    writeCommandByte(0x06);

    writeCommandByte(0x01);

    writeCommandByte(0x02);

    SPI_send(0);
    delayMilli();
}
Esempio n. 3
0
File: LCD.c Progetto: JennaeN/LCD
void writeString(char * string) {
	int i = 0;
	LCDcon |= RS_MASK;
	for (i = 0; i < 8; i++) {
		LCD_write_8(string[i]);	//send data in the string to be written
		delayMilli();
	}
}
Esempio n. 4
0
File: lcd.c Progetto: ntaormina/Lab4
void writeDataByte(char dataByte)
{
    LCDCON |= RS_MASK;
    LCD_write_8(dataByte);
    delayMilli();
}
Esempio n. 5
0
File: lcd.c Progetto: ntaormina/Lab4
void writeCommandByte(char commandByte)
{
    LCDCON &= ~RS_MASK;
    LCD_write_8(commandByte);
    delayMilli();
}
Esempio n. 6
0
File: lcd.c Progetto: ntaormina/Lab4
void writeCommandNibble(char commandNibble)
{
    LCDCON &= ~RS_MASK;
    LCD_write_4(commandNibble);
    delayMilli();
}