void Welcome(unsigned char c[],unsigned char d[])
{
unsigned int i=0;

lcdcmd(0x01);
DelayMs(10);
lcdcmd(0x80);
DelayMs(10);

i=0;
while(c[i]!='\0')
{
lcdData(c[i]);
i++;
}

lcdcmd(0xc0);
DelayMs(10);

i=0;
while(d[i]!='\0')
{
lcdData(d[i]);
i++;
}
}
Exemplo n.º 2
0
void welcome(void)
{
unsigned int i=0;
unsigned char c[]="WELCOME TO RFID";	 
unsigned char d[]="SECURITY SYSTEM";

lcdcmd(0x01);
DelayMs(10);
lcdcmd(0x80);
DelayMs(10);

while(c[i]!='\0')
{
lcdData(c[i]);
i++;
}

lcdcmd(0xc0);

i=0;
while(d[i]!='\0')
{
lcdData(d[i]);
i++;
}
}	
Exemplo n.º 3
0
void numToLcd(unsigned char num)
{
	
	lcdData((num/100)+0x30);
	lcdData(((num/10)%10)+0x30);
	lcdData((num%10)+0x30);
	
}
void update_time (void)
{
	lcd_gotoxy(1,1);
	if(hours < 10)		lcdData('0');
	lcd_print(itoa((int)hours,str1,10));
	lcd_print(":");
	
	if(minutes < 10)	lcdData('0');
	lcd_print(itoa((int)minutes,str1,10));
	lcd_print(":");
	
	if(seconds < 10)	lcdData('0');
	lcd_print(itoa((int)seconds,str1,10));
}
Exemplo n.º 5
0
void prints(const rom char * message){	// Write message to LCD (C string type)
lcdcmd(0x8); // disable display;
		while (*message){			// Look for end of string
					lcdData(*message++);
					}
	lcdcmd(0xE); // enable display;
	}
void display(unsigned char s,t,u)
{
s=s+0x30;			//convert each digit to equivalent ASCII value
t=t+0x30;
u=u+0x30;

//Move the cursor to position 5 on LCD
DelayMs(50);

lcdData(u);			//Display the digits one by one on LCD
DelayMs(50);
lcdData(t);
DelayMs(50);
lcdData(s);
DelayMs(50);
} 
void ConvertAndDisplay(unsigned int value1,unsigned char c[])
{
unsigned int i,a=0,j;
unsigned char d1,d2,d3;
for(i=0;i<value1;i++)
a=a+1;
lcdcmd(0x01);
DelayMs(10);
lcdcmd(0x80);
DelayMs(10);


j=0;
while(c[j]!='\0')
{
lcdData(c[j]);
j++;
}
d1=a%10;		//digits before desible point
a=a/10;
d2=a%10;
a=a/10;
d3=a%10;

lcdcmd(0xc0);
DelayMs(10);

display(d1,d2,d3);
}
Exemplo n.º 8
0
void lcdString(char* str)
{
	while (*str != 0) 
	{
		lcdData(*str);
		++str;
	}	
}
Exemplo n.º 9
0
void prints(char *str)
{
    while (*str)
    {
    	lcdData(*str);		// point to each character
    	str++;
    }
}
void lcd_str(int skip,char* ptr) {
    if(skip==1) {
        *ptr++;
    }
    while(*ptr != 0) {
        lcdData(*ptr++);
    }
}
Exemplo n.º 11
0
void display(long int f)
{
	int i;
	char c;

	hex2bcd(f);

	lcdCmd(0x80 + 4);
	_delay_us(200);

	for (i=1; i<8; i++) {
		c = str[i];
		if (i==5) {
			lcdData('.');
		}
		lcdData(c);
	}
}
Exemplo n.º 12
0
/** Clear the screen
 *
 * Clear the entire display.
 *
 */
void lcdClear() {
  // Set the position
  lcdCommand(0x80);
  lcdCommand(0x40);
  uint16_t index;
  for(index = 0; index < (LCD_COL * LCD_ROW); index++) {
    lcdData(CLEAR_BYTE);
  }
}
//*******************************************************************************
void lcd_print(char *str)
{
	unsigned char i = 0;
	
	while(str[i] != 0)
	{
		lcdData(str[i]);
		i++;
	}
}
Exemplo n.º 14
0
void lcdBlitPortrait(uint8_t *img, unsigned char rows, unsigned char cols,
                     unsigned char x, unsigned char y) {
  int j;
  lcdCommand(LCD_PAGE_SET(x/8));
  lcdCommand(LCD_COLUMN_SET_HI(4 + y));
  lcdCommand(LCD_COLUMN_SET_LO(4 + y));
  for(j=0;j<8;j++) {
    lcdData(img[j]);
  }
}
Exemplo n.º 15
0
void integerToLcd(int integer )
{
	//	Break down the original number into the thousands, hundreds, tens,
	//	and ones places and then immediately write that value to the LCD
unsigned char thousands	,hundreds,tens,ones;
thousands = integer / 1000;
	
    lcdData(thousands + 0x30);
	
	 hundreds = ((integer - thousands*1000)-1) / 100;

	lcdData( hundreds + 0x30);
tens=(integer%100)/10;	

	lcdData( tens + 0x30);
	ones=integer%10;

	lcdData( ones + 0x30);
}
Exemplo n.º 16
0
void integerToLcd(unsigned int integer)
{
	unsigned char tenthousands,thousands,hundreds,tens,ones;

//	tenthousands = integer / 10000;			// N---- or 0----
//	lcdData(tenthousands + 0x30);

	thousands = integer % 10000 / 1000;		// xN--- or x0---
	lcdData(thousands + 0x30);

	hundreds = integer % 1000 / 100;		// xxN-- or xx0--
	lcdData(hundreds + 0x30);

	tens= integer % 100 / 10;				// xxxN- or xxx0-
	lcdData(tens + 0x30);

	ones=integer % 10;						// xxxxN or xxxx0
	lcdData(ones + 0x30);
}
void update_date (void)
{
	lcd_gotoxy(10,1);
	switch(day)
	{
		case 1:
			lcd_print("SAT");
			break;
		case 2:
			lcd_print("SUN");
			break;
		case 3:
			lcd_print("MON");
			break;
		case 4:
			lcd_print("TUE");
			break;
		case 5:
			lcd_print("WED");
			break;
		case 6:
			lcd_print("THR");
			break;
		case 7:
			lcd_print("FRI");
			break;
		default:
			lcd_print("ERR");
	}
	lcd_gotoxy(1,2);
	if(date < 10)		lcdData('0');
	lcd_print(itoa((int)date,str1,10));
	lcd_print(":");
	
	if(month < 10)	lcdData('0');
	lcd_print(itoa((int)month,str1,10));
	lcd_print(":");
	
	lcdData('2');
	lcdData('0');
	lcd_print(itoa((int)year,str1,10));
}
Exemplo n.º 18
0
void update()
{
	long int f;

	if (tx) {
		f = freq;
		if (shiftSwitch)
			f += shift;
		setFreq(f);
		display(f);
		lcdCmd(0x8f);
		lcdData('T');
	}
	else {
		setFreq(freq - IF);
		display(freq);
		lcdCmd(0x8f);
		lcdData('R');
	}
}
Exemplo n.º 19
0
void AQM1248A::showPic()
{
    for(int page=0;page<6;page++){
      lcdCmd(0xb0+page);        //ページアドレス選択
      lcdCmd(0x10);             //カラムアドレス上位4bit = 0000
      lcdCmd(0x00);             //カラムアドレス下位4bit = 0000
      for(int col=0;col<128;col++){
        lcdData(pic[page][col]);
      }
    }
}
Exemplo n.º 20
0
int prints(char *s)
  {
int largo = strlen(s);
    while (*s)
      {
	 lcdData(*s);
	 s++;
      }

    return largo;
  }
void lcd_generate(unsigned char location, unsigned char *ptr)
{
	unsigned char i;
	if(location<8)
	{
		lcdCommand(0x40+(location*8));
		for(i=0;i<8;i++)
		{
			lcdData(ptr[i]);	
		}	
	}
}
Exemplo n.º 22
0
/** Write a single character
 *
 * Display a single ASCII character at the position described by the row and
 * column parameters. Note that the row indicates an 8 pixel high character
 * row while the column represents individual pixels. This code uses a built
 * in character set where each character is 5 pixels wide and adds a single
 * column of pixels as spacing giving a total width of 6 pixels.
 *
 * @param row the row number (0 to 5) to display the character.
 * @param col the column position (0 to 83) for the start of the left side of
 *            the character.
 * @param ch  the character to display. If the character is out of range it
 *            will be replaced with the '?' character.
 */
void lcdPrintChar(uint8_t row, uint8_t acol, char ch, uint8_t size) {
  // Make sure it is on the screen
  if((row>=LCD_ROW)||(acol>=LCD_COL)) {
    return;
  }
  // If the character is invalid replace it with the '?'
  if((ch<0x20)||(ch>0x7f)) {
    ch = '?';
  }
  
  uint8_t i;
  for(i = 0; i < size; i++) {
    uint8_t col = acol;
    // Set the starting address
    lcdCommand(0x80 | col);
    lcdCommand(0x40 | ((row + i) % LCD_ROW));
    // And send the column data
    const uint8_t *chdata = SMALL_FONT + ((ch - 0x20) * 5);
    uint8_t pixels;

    for(pixels = 0; (pixels < DATA_WIDTH) && (col < LCD_COL); pixels++, col++, chdata++) {
      uint8_t data = pgm_read_byte_near(chdata);

      if(size != 2) {
        lcdData(data);
        continue;
      }
      data = bitScale(data, i * 4);
      lcdData(data);
      lcdData(data);
    }

    // Add the padding byte
    if(col < LCD_COL) {
      lcdData(CLEAR_BYTE);
    }
  }
}
Exemplo n.º 23
0
void print_packet()
{
	volatile uint8_t* p = uart_get_frame();
	uint8_t i;

	if( p )
	{
		lcdData('|');
		for( i = 14; i < p[2]; i++ )
		{
			hex2Lcd( p[i] );
		}
	}
}
Exemplo n.º 24
0
void lcdPrintPortrait(char *msg, char line) {
  int i, j;
  for(i=0;i<8;i++) {
    if(msg[i] == 0) {
      break;
    }
    lcdCommand(LCD_PAGE_SET(i));
    lcdCommand(LCD_COLUMN_SET_HI(4 + line * 8));
    lcdCommand(LCD_COLUMN_SET_LO(4 + line * 8));
    for(j=0;j<8;j++) {
      lcdData(font[msg[i]][j]);
    }
  }
}
Exemplo n.º 25
0
void displaySmeter(int level) 
{
	short n = 16;

	lcdCmd(0xc0);

	// chars in the full bar are 3 vertical lines
	while(level>=3 && n>0) {
		lcdData(2);
		level -= 3;
		n--;
	}
	
	// last char 0, 1 or 2 lines
	switch (level) {
		case 2: lcdData(1); break;
		case 1: lcdData(0); break;
		default: lcdData(' '); break;
	}

	// clear any chars to the right
	while (--n > 0) lcdData(' ');
}
Exemplo n.º 26
0
void lcdClear() {
  int i, j;
  
  for(i=0;i<8;i++) {
    lcdCommand(LCD_PAGE_SET(i));
    lcdCommand(LCD_COLUMN_SET_HI(4));
    lcdCommand(LCD_COLUMN_SET_LO(4));
    for(j=0;j<128;j++) {
      lcdData(0x00);
    }
  }
  lcdCommand(LCD_PAGE_SET(0));
  lcdCommand(LCD_COLUMN_SET_HI(4));
  lcdCommand(LCD_COLUMN_SET_LO(4));
}
Exemplo n.º 27
0
void sucessRx()
{
unsigned int i=0;
unsigned char c[]="ACCESS GRANTED";

lcdcmd(0x01);
DelayMs(10);
lcdcmd(0x80);
DelayMs(10);

while(c[i]!='\0')
{
lcdData(c[i]);
i++;
}
}
Exemplo n.º 28
0
void unknown(void)
{
unsigned int i=0;
unsigned char c[]="ACCESS DENIED";

lcdcmd(0x01);
DelayMs(10);
lcdcmd(0x80);
DelayMs(10);

while(c[i]!='\0')
{
lcdData(c[i]);
i++;
}
}
Exemplo n.º 29
0
Arquivo: lcd.c Projeto: d0niek/SW-2015
/*****************************************************************************
 *
 * Description:
 *    Write/draw one character at current xy-position.
 *    The xy-position is updated afterwards
 *
 ****************************************************************************/
void
lcdPutchar(tU8 data) {
    if (data == '\n')
        lcdNewline();
    else if (data != '\r') {
        if (setcolmark == TRUE) {
            textColor = data;
            setcolmark = FALSE;
        }
        else if (data == 0xff)
            setcolmark = TRUE;
        else if (lcd_x <= 124) {
            lcdData(data);
        }
    }
}
Exemplo n.º 30
0
void lcdUint(uint16_t i)
{
	int8_t log2 = 0;
	int16_t tmp = i;
	
	while (tmp > 15)
	{
		tmp >>= 4;
		log2 += 4;	
	}
	
	while (log2 >= 0)
	{
		int16_t div = i >> log2;
		lcdData(div + (div > 9 ? 'A'- 10: '0'));
		i -= div << log2;
		log2 -= 4;
	}	
}