Commit 7befa503 authored by Martin Vítek's avatar Martin Vítek
Browse files

Fixed timing & bit positions

parent 47ecd9f0
......@@ -36,7 +36,7 @@ void HD44780::init(void)
_delay_ms(5);
len();
_delay_us(150);
_delay_us(200);
len();
......@@ -46,11 +46,11 @@ void HD44780::init(void)
//send_instruction(0x28);
set_function_set(LINES_2 | DATA_4_BITS | FONT_5x8);
//send_instruction(0x06);
//send_instruction(0x06);
set_entry_mode(AUTO_INCREMENT | DONT_SHIFT_ENTIRE_DISPLAY);
//send_instruction(0x0c);
set_display_control(DISPLAY_ON | CURSOR_ON);
set_display_control(DISPLAY_ON | CURSOR_OFF);
set_shift_mode(SHIFT_CURSOR | SHIFT_LEFT);
......@@ -167,9 +167,9 @@ void HD44780::write_ftext(const char* text)
void HD44780::len(void) //impuls Enable do LCD
{
enable.on();
_delay_us(2);
_delay_us(3);
enable.off();
_delay_us(2);
_delay_us(40);
}
void HD44780::write_data(char c)
......
......@@ -54,11 +54,11 @@ class HD44780
enum display_controls
{
DISPLAY_ON = 0x01,
DISPLAY_ON = 0x04,
DISPLAF_OFF = 0x00,
CURSOR_OFF = 0x00,
CURSOR_ON = 0x02,
CURSOR_BLINK = 0x06
CURSOR_BLINK = 0x03
};
enum shift_modes
......
......@@ -33,23 +33,10 @@ int main()
HD44780 lcd(lcd_config);
lcd.init();
for (uint8_t i = 0; i < 2; i++)
{
lcd.gotoxy_new(i,0);
for (uint8_t j = 0; j < 40; j++)
{
//lcd.gotoxy_new(i,j);
lcd.write_char('a');
}
}
//lcd.gotoxy(1,1);
lcd.gotoxy_new(0,0);
lcd.write_char('x');
//lcd.gotoxy(2,1);
//lcd.gotoxy(1,2);
lcd.write_text("Ahoj! :)");
lcd.write_text("Safe Soldering");
lcd.gotoxy_new(1,4);
lcd.write_text("Station v1.0");
for(;;)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment