此产品由一个12管脚的4位7段共阳极数码管和一个控制芯片TM1637构成。该模块采用沉金工艺,外观更加美观,同时采用防插反接口,操作更加安全,插口一边有大写字母I表示该模块采用IIC协议通信,另一边是数码管的图标标志。此产品可以应用在时间显示、跑表显示以及其他需要显示数字的设备上。
产品侧面展示
产品正面展示
产品背面展示
1. 工作电压 : +5v
2. 尺寸大小:45mm x 25mm
3. 重量大小:8g
4. 通信协议:IIC
引脚定义:
SCK:IIC时钟信号引脚
SDA:IIC数据信号引脚
-:电源地
+:电源正极
应用实例电路:
#include "TM1637.h" #define ON 1 #define OFF 0 int8_t TimeDisp[] = {0x00,0x00,0x00,0x00}; unsigned char ClockPoint = 1; unsigned char Update; unsigned char halfsecond = 0; unsigned char second; unsigned char minute = 0; unsigned char hour = 12; #define CLK A5//pins definitions for TM1637 and can be changed to other ports #define DIO A4 TM1637 tm1637(CLK,DIO); void setup() { tm1637.set(); tm1637.init(); Timer1.initialize(500000);//timing for 500ms Timer1.attachInterrupt(TimingISR);//declare the interrupt serve routine:TimingISR } void loop() { if(Update == ON) { TimeUpdate(); tm1637.display(TimeDisp); } } void TimingISR() { halfsecond ++; Update = ON; if(halfsecond == 2) { second ++; if(second == 60) { minute ++; if(minute == 60) { hour ++; if(hour == 24)hour = 0; minute = 0; } second = 0; } halfsecond = 0; } // Serial.println(second); ClockPoint = (~ClockPoint) & 0x01; } void TimeUpdate(void) { if(ClockPoint)tm1637.point(POINT_ON); else tm1637.point(POINT_OFF); TimeDisp[0] = hour / 10; TimeDisp[1] = hour % 10; TimeDisp[2] = minute / 10; TimeDisp[3] = minute % 10; Update = OFF; }
SCK引脚接到控制器的A5口, SDA引脚接到控制器的A4口。+和-分别接到电源的+5V和GND。
注意程序中包含的头文件需要下载,程序下载进去之后就可以正常显示时钟了。
购买地址:
中文官网购买地址: http://www.alsrobot.cn/goods-743.html
淘宝购买地址: https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-3667083713.9.AUOJXb&id=530265562288
近期新闻
热门新闻
奥松智能微信