Add display timings. Don't disable the display when clearing.
This commit is contained in:
parent
b6208b0e6d
commit
d86b6c596b
|
@ -42,18 +42,24 @@ void display_init(display_t *disp) {
|
|||
}
|
||||
|
||||
void display_clear(display_t *disp) {
|
||||
write_instruction(disp, 0x01);
|
||||
write_instruction(disp, 0x02);
|
||||
write_instruction(disp, 0b00000001);
|
||||
_delay_ms(3);
|
||||
write_instruction(disp, 0b00000010);
|
||||
_delay_ms(3);
|
||||
|
||||
}
|
||||
|
||||
void display_enable(display_t *disp) {
|
||||
// write_instruction(disp, 0x0e);
|
||||
write_instruction(disp, 0b00001100);
|
||||
_delay_us(100);
|
||||
write_instruction(disp, 0b00000100);
|
||||
_delay_us(100);
|
||||
}
|
||||
|
||||
void display_set_location(display_t *disp, size_t column, size_t row) {
|
||||
void display_set_location(display_t *disp, size_t row, size_t column) {
|
||||
size_t addr = row * 40 + column;
|
||||
write_instruction(disp, 0b10000000 | addr);
|
||||
_delay_us(100);
|
||||
}
|
||||
|
||||
void display_write_message(display_t *disp, const char *msg) {
|
||||
|
|
Loading…
Reference in New Issue