nimaltd / tm1637

tm1637 display library for STM32

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TM1637 Display driver for STM32

How to use this Library:

  • Put all files into your project.
  • Set your Configuration in tm1637_config.h.
  • Select 2 pins on cubemx as gpio open drain.
  • Create a strcuture tm1637_t your_struct.
  • Call tm1637_init().

example:

#include "tm1637.h"
tm1637_t disp;

const uint8_t seg_LOAD[4] =  {0x38, 0x5c, 0x77, 0x5e}; // display LOAD
.
.
.
int main()
{
  .
  .
  .
  tm1637_init(&disp, CLK1_GPIO_Port, CLK1_Pin, DIO1_GPIO_Port, DIO1_Pin);
  tm1637_write_segment(&disp, seg_LOAD, 4, 0);
  HAL_Delay(1000);
  tm1637_write_float(&disp, -1.23, 2, 0);
  HAL_Delay(1000);
  tm1637_write_int(&disp, 56, 0);
}

About

tm1637 display library for STM32

License:GNU General Public License v3.0


Languages

Language:C 100.0%