real use of the display
Some checks failed
Some checks failed
This commit is contained in:
@ -70,6 +70,7 @@ int main(void)
|
||||
printf("font width %d, font height %d\n",
|
||||
font_width, font_height);
|
||||
}
|
||||
cfb_framebuffer_set_font(dev, 0);
|
||||
|
||||
printf("x_res %d, y_res %d, ppt %d, rows %d, cols %d\n",
|
||||
x_res,
|
||||
@ -90,10 +91,10 @@ int main(void)
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
for (int i = 0; i < MIN(x_res, y_res); i++)
|
||||
{
|
||||
int ret;
|
||||
char str_v[15] = {0};
|
||||
char str_i[15] = {0};
|
||||
|
||||
ret = sensor_sample_fetch(ina);
|
||||
if (ret < 0)
|
||||
@ -116,12 +117,18 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("voltage: %d.%06d\tcurrent: %d.%06d\n", voltage.val1, voltage.val2, current.val1, current.val2);
|
||||
sprintf(str_v, "V:%d.%06d", voltage.val1, voltage.val2);
|
||||
sprintf(str_i, "I:%d.%06d", current.val1, current.val2);
|
||||
|
||||
printf("%s\t%s\n", str_v, str_i);
|
||||
|
||||
cfb_framebuffer_clear(dev, false);
|
||||
if (cfb_print(dev,
|
||||
"0123456789mMgj!\"§$%&/()=",
|
||||
i, i))
|
||||
if (cfb_print(dev, str_v, 0, 0))
|
||||
{
|
||||
printf("Failed to print a string\n");
|
||||
continue;
|
||||
}
|
||||
if (cfb_print(dev, str_i, 0, 16))
|
||||
{
|
||||
printf("Failed to print a string\n");
|
||||
continue;
|
||||
@ -132,7 +139,6 @@ int main(void)
|
||||
k_sleep(K_MSEC(20));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
int ret;
|
||||
unsigned int period_ms = BLINK_PERIOD_MS_MAX;
|
||||
|
Reference in New Issue
Block a user