Esempio n. 1
0
int main(void)
{
	lcd_init();
	for (;;) {
		const char msg[] = "by tommyo";
		lcd_set_ddram_address(0);
		lcd_puts("avr_hd44780");
		_delay_ms(500);
		lcd_set_position(1, 6);
		lcd_on_off_control(1, 1, 0);
		_delay_ms(500);
		for (uint8_t i = 0; i < sizeof(msg)-1; i++) {
			_delay_ms(150);
			lcd_putchar(msg[i]);
		}
		_delay_ms(300);
		lcd_on_off_control(1, 1, 1);
		_delay_ms(3000);
		lcd_on_off_control(1, 0, 0);
		for (uint8_t i = 0; i < 2; i++) {
			for (uint8_t  k = 0; k < 16; k++) {
				for (uint8_t j = 0; j < 2; j++) {
					lcd_set_position(j, k);
					lcd_putchar((i % 2) ? ' ' : 0xFF);
				}
				_delay_ms(25);
			}
		}
		lcd_clear();
		_delay_ms(500);
	}
}
Esempio n. 2
0
File: test.c Progetto: hubuyu/LCD602
unsigned int lcd_wr_string(int fd , unsigned char x , unsigned y , char *string  )
{
	int err ;
	err = lcd_set_position(fd , x , y );
	if(err==-1)
		printf("error \n");
	while(*string){
		err = ioctl(fd , SEND_DATA , *string++ );
		if( err<0 ){
			printf("error- %d send data %c \n",err, *string);
			return -1 ;
		}

	}
	return 0 ;
}
Esempio n. 3
0
int main()
{
  //SWICH_D = 0x00; // read from swich
  lcd_init();
  lcd_cursor_on();
  lcd_set_position(0,0);
  init_dcf77_interupt();
  home_init();
  /*timer_init();*/

  while (1)
  {
    handle_menu();
  }

  return 0;
}