Add driver for Samsung 16LF01 VFD display.
This commit is contained in:
parent
c1aa8f2e73
commit
54918803bb
6 changed files with 247 additions and 0 deletions
3
examples/vfd16LF01_counter/Makefile
Normal file
3
examples/vfd16LF01_counter/Makefile
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
PROGRAM=vfd16lf01_counter
|
||||
EXTRA_COMPONENTS = extras/vfd16lf01
|
||||
include ../../common.mk
|
||||
44
examples/vfd16LF01_counter/vfd16LF01_counter.c
Normal file
44
examples/vfd16LF01_counter/vfd16LF01_counter.c
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Simple cunter that is displayed on 16lf01 VFD display.
|
||||
* Author: Grzegorz Hetman - ghetman@gmail.com
|
||||
*/
|
||||
|
||||
#include "espressif/esp_common.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
// Samsung VFD 16lf01 driver
|
||||
#include "vfd16lf01/vfd16lf01.h"
|
||||
|
||||
void counter(void *pvParameters)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
|
||||
uint8_t pin_clk = 15;
|
||||
uint8_t pin_rst = 13;
|
||||
uint8_t pin_data = 0;
|
||||
uint8_t digits = 16;
|
||||
uint8_t brightness = 31; // Range 0-31
|
||||
|
||||
vfd_16lf01_init(pin_clk, pin_rst, pin_data, digits, brightness);
|
||||
vfd_16lf01_print("ESP-OPEN-RTOS ;)", pin_clk, pin_data);
|
||||
|
||||
vTaskDelay(5000 / portTICK_RATE_MS);
|
||||
|
||||
while(1) {
|
||||
char msg[16];
|
||||
sprintf(msg, "Counter %d", count++);
|
||||
printf("%s\n", msg);
|
||||
vfd_16lf01_print(msg, pin_clk, pin_data);
|
||||
vTaskDelay(250 / portTICK_RATE_MS);
|
||||
}
|
||||
}
|
||||
|
||||
void user_init(void)
|
||||
{
|
||||
uart_set_baud(0, 115200);
|
||||
printf("SDK version:%s\n", sdk_system_get_sdk_version());
|
||||
xTaskCreate(&counter, (signed char *)"counter", 256, NULL, 2, NULL);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue