这是一款类似 hud(抬头显示器,又称平视显示器)的时钟,通过 wifi 获取当前时间。它基于 esp32 控制器,使用四个常见的 8×8 点阵显示单元,由 max7219 芯片驱动。
组件清单
8×8 点阵显示单元(max7219)× 4
esp32 微控制器 × 1
1mm 厚,165 x 75mm 亚克力板 × 1
3d 打印外壳
外壳打印没有支撑,采用丙烯酸板。
具体数值为:w=165mm,h=75mm。
最后可使用哑光黑色油漆涂抹外壳。我使用了极低反射率的油漆(musou black),涂满装置和机身的上。
3d 打印文件,在项目文件库中下载。
https://make.quwj.com/project/458
安装 esp32 微控制器
将 esp32 微控制器连接到点阵显示单元。将 max72xx 库安装到 arduino ide 中。
以我的项目为例,连接了 din-16、cs-17、clk-21。源代码中的连接是可变的。可见下文第115-117行。
#define clk_pin 21 // or sck#define data_pin 16 // or mosi#define cs_pin 17 // or ss
在源代码中配置 wifi。你也可以使用 smartconfig 智能手机应用程序来执行此操作。
#define wifi_ssid ssid // your wifi's ssid#define wifi_pass pass // your wifi's password
将微控制器安装到外壳的外部。当然,你也可以使用任何其他的微控制器。
时钟文件,在项目文件库中下载。
https://make.quwj.com/project/458
#include #include #include //////////////////////////////// max7219 hardware configuration//////////////////////////////#define brightness max_intensity/2#define hardware_type md_max72xx::fc16_hw#define max_devices 4#define clk_pin 21 // or sck#define data_pin 16 // or mosi#define cs_pin 17 // or ssmd_max72xx mx = md_max72xx(hardware_type, data_pin, clk_pin, cs_pin, max_devices); // arbitrary pins//////////////////////////////// wifi and ntp section//////////////////////////////// switch between 24h (12 rotors) / 12h (10 rotors)#define hour12 false// ntp settings#define timezone 9 // timezone (gmt = 0, japan = 9)#define ntp_server pool.ntp.org#define wifi_smartconfig false#if !wifi_smartconfig// if you do not use smartconfifg, please specify ssid and password here#define wifi_ssid ssid_here // your wifi's ssid#define wifi_pass pass_here // your wifi's password#endifvoid getntp(void) { for(int i = 0; wifi.status() != wl_connected; i++) { if(i > 30) { esp.restart(); } serial.println(waiting for wifi connection..); delay(1000); } configtime(timezone * 3600l, 0, ntp_server); printlocaltime();}void printlocaltime() { struct tm timeinfo; if (!getlocaltime(&timeinfo)) { serial.println(failed to obtain time); return; } serial.println(&timeinfo, %a, %y-%m-%d %h:%m:%s);}void wifisetup() { int wifimotion = 400; // while wainting for wifi, large motion int smatconfigmotion = 100; // while wainting for smartconfig, small motion wifi.mode(wifi_sta);#if wifi_smartconfig wifi.begin();#else wifi.begin(wifi_ssid, wifi_pass);#endif showtext(wifi..); for (int i = 0; ; i++) { serial.println(connecting to wifi...); delay(1000); if (wifi.status() == wl_connected) { break; }#if wifi_smartconfig if(i > 6) break;#endif }#if wifi_smartconfig if (wifi.status() != wl_connected) { wifi.mode(wifi_ap_sta); wifi.beginsmartconfig(); //wait for smartconfig packet from mobile serial.println(waiting for smartconfig.); while (!wifi.smartconfigdone()) { serial.print(.); showtext(smcfg); delay(1000); mx.clear(); delay(500); } serial.println(); serial.println(smartconfig received.); //wait for wifi to connect to ap serial.println(waiting for wifi); showtext(wifi); while (wifi.status() != wl_connected) { delay(1000); serial.print(,); } mx.clear(); delay(500); } serial.println(wifi connected.);#endif serial.print(ssid: ); serial.println(wifi.ssid()); serial.print(ip address: ); serial.println(wifi.localip());}void setup(){ serial.begin(115200); serial.println(start); mx.begin(); mx.control(md_max72xx::intensity, brightness); mx.control(md_max72xx::update, md_max72xx::on); mx.clear(); wifisetup(); getntp(); // get current time}void showtext(char *message) { char *p = message; uint8_t charwidth; uint8_t cbuf[8]; // this should be ok for all built-in fonts int sum = -2; mx.clear(); while (*p != '�') { charwidth = mx.getchar(*p++, sizeof(cbuf) / sizeof(cbuf[0]), cbuf); mx.transform(md_max72xx::tsl); mx.transform(md_max72xx::tsl); // double column space for (uint8_t i=0; i
完成
将显示单元安装到位并插入亚克力板,整个项目就完成了。
via instructables.com/hud-like-wifi-sync-clock-transparent-dot-matrix-di/
Avago推出VMMK-3xxx系列最小射频放大器
【节能学院】预付费能源管理系统在上海康桥某产业园项目设计与应用
美新AEC-Q100车规级产品系列又增添新成员
万亿投资智慧城市:要跨界更要安全
动力电池的种类介绍
ESP32+LED点阵DIY透明面板的数字时钟
电容器公式的介绍,电容计算公式是怎样的
波动AC输入引起的LED闪烁肿么办?这个解决方案很有效
介绍常见的几款瞻博网络Juniper光模块型号
采用雪崩管级联实现UWB脉冲产生电路的设计
C/S架构的优点
国轩高科宣布三元811电池预计2019年实现小批量生产
AI PC元年会带火PC集群吗?云游戏迎来黄金时代Stable Diffusion显存之选:12G及格,16G自由,24G上天
低功耗模数转换器FS511的特性、引脚功能和应用分析
海思HI3515按键中断驱动程序
一石几鸟:华为缘何此时对三星发起专利战?
漫途车辆排队叫号系统提高车辆调度效率
调心滚子轴承部件的基本生产工艺流程
聊聊AI研发的七大支柱
诺基亚6配置是失败的?配置高端诺基亚8会给你好看