-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
38 lines (29 loc) · 882 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <pico/stdlib.h>
#include "hd44780.h"
#include <string.h>
int main()
{
PIO pio = pio0;
int sm = 0;
int pin = 16;
float freq = 2000000;
hd44780_init(pio, sm, pin, freq);
hd44780_functionset(false, true, false);
hd44780_cleardisplay();
hd44780_displaycontrol(true, false, false);
char buf[64];
int i = 0;
while(true)
{
sprintf(buf, "--%08d%08d--", i, i);
i++;
hd44780_setddramaddr(0x00);
hd44780_writebytes((const uint8_t *)buf, strlen(buf));
hd44780_setddramaddr(0x40);
hd44780_writebytes((const uint8_t *)buf, strlen(buf));
hd44780_setddramaddr(0x14);
hd44780_writebytes((const uint8_t *)buf, strlen(buf));
hd44780_setddramaddr(0x54);
hd44780_writebytes((const uint8_t *)buf, strlen(buf));
}
}