项目日志:Day9 --- 2020.7.31

上午

写完了所有老化程序;
解决了依次按键显示加1的问题(在外层加了一个for循环);
贴上main.c的代码:

#include "delay.h"
#include "sys.h"
#include "Key.h"
#include "74hc595.h"
#include "Input.h"
#include "Output.h"
#include "Epprom.h"
#include "LED.h"

u8 t;

int main(void)
{
	delay_init(); //延时函数初始化
	//LED_Init();		  	 	//初始化与LED连接的硬件接口
	KEY_Init(); //初始化与按键连接的硬件接口
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	HC595_Init();
	IN_Init();
	OUT_Init();
	delay_init();
	HC595_Init();
	AT24CXX_Init();
	AT24CXX_Check();
	HC595SendData(0x00);

	int i, j;
	for (j = 1; j <= 4; j++) {		//KEY5有BUG,所以分成两部分,跳过KEY5;
		while (1) { // 循环读按键值;
			t = KEY_Scan(0);
			if (t == j) {
				break; // 读到键值则跳出;
			}
			else {
				Light_Error();
			}
		}
		for (i = 0; i < 10;) {
			Light_upi(i);	//显示'i, 8, 8, 8, 8, 8';
			t = KEY_Scan(0);
			if (t == j) {
				i++;
			}
		}
	}

	for (j = 6; j <= 9; j++) {
		while (1) { // 循环读按键值;
			t = KEY_Scan(0);
			if (t == j) {
				break; // 读到键值则跳出;
			}
			else {
				Light_Error();
			}
		}
		for (i = 0; i < 10;) {
			Light_upi(i);
			t = KEY_Scan(0);
			if (t == j) {
				i++;
			}
		}
	}
	
	int tp = 0, dx = 0, y, x;
	OUT1 = 1, OUT2 = 1, OUT3 = 1, OUT4 = 1, OUT5 = 1, OUT6 = 1;
	//	 	OUT1=0,OUT2=0,OUT3=0,OUT4=0,OUT5=0,OUT6=0;
	LED1 = 0;
	LED2 = 0;
	WEI1 = 1;
	WEI2 = 1;
	WEI3 = 1;
	WEI4 = 1;
	WEI5 = 1;
	WEI6 = 1;

	Light_up(0);
	y = AT24CXX_ReadOneByte(12);
	while (1)
	{
		while (In1 == 0 && In2 == 0 && In3 == 0 && In5 == 0 && In6 == 07 & In7 == 0)
		{
			while (dx == 0)
			{
				Light_up(8);
				dx++;
			}
			if (KEY1 == 0 && y == 1)
			{
				Light_up(1);
				y = 1;
				if (tp == 0)
				{
					AT24CXX_WriteOneByte(12, y);
					tp = 1;
				}
			}
			if (KEY2 == 0 && y == 2)
			{
				Light_up(1);
				y = 2;
				if (tp == 1)
				{
					AT24CXX_WriteOneByte(12, y);
					tp = 0;
				}
			}
		}
		Light_Error3();
	}

	return 0;
}

下午

目前的两个任务:

  1. 解决单片机与屏之间的数据读写问题;
  2. 解决屏幕时间读取与显示问题;
  3. 批量烧录问题(长远问题);

Task 1

首先开启数据自动上传功能:
修改CFG文件中的标志位
在这里插入图片描述
在地址5中修改,初始值为0x38
在这里插入图片描述
按照配置说明来修改的话,该地址上的二进制值为:00111000 = 0x38
也就是说默认开启了数据变量自动上传;


Task 2

查资料找到读RTC指令,可能可以通过故障时读RTC时间,再发送给HEX控件显示,来达到目的;
在这里插入图片描述
在这里插入图片描述
简单设置了一下RTC控件;
载入屏内后是默认显示 2000-00-00 00:00:00
说明需要有些设置来启动计时;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
优化下面代码.bg { width: 100%; height: 100vh; background-image: url('../../assets/img/info-bg.png'); background-size: 100% 100%; background-repeat: no-repeat; position: relative; font-family: AlibabaPuHuiTiR; .goBack { position: absolute; top: 34px; right: 65px; cursor: pointer; color: #ffffff; width: 181px; padding: 15px 10px; background: rgba(24, 31, 30, 0.52); border: 1px solid #4a524e; border-radius: 5px; font-size: 18px; font-family: AlibabaPuHuiTiR; z-index: 111; display: flex; flex-direction: row; justify-content: space-between; align-items: center; } .home-left { position: absolute; top: 18%; left: 40px; width: 41%; height: 76%; font-size: 24px; color: #ffffff; } .unit { font-size: 24px; color: #636363; } .home-left-title { font-size: 24px; color: #ffffff; line-height: 36px; } .home-right { position: absolute; top: 18%; right: 88px; width: 46%; height: 78%; } .model { display: flex; justify-content: center; align-items: center; height: 90%; } #threeContained { width: 100%; height: 100%; } .model-qk-img { width: 82%; height: 90%; background-image: url('../../assets/img/howo.png'); background-size: 100% 100%; background-repeat: no-repeat; } .model-zk-img { width: 56%; height: 90%; background-image: url('../../assets/img/heavyT.png'); background-size: 100% 100%; background-repeat: no-repeat; } .model-gj-img { width: 82%; height: 90%; background-image: url('../../assets/img/transit.png'); background-size: 100% 100%; background-repeat: no-repeat; } .car-online { margin-bottom: 50px; } } .day-data { display: flex; flex-direction: row; justify-content: space-between; align-items: center; height: 29%; margin-left: 30px; } .day-val { width: 40%; } .prefix { display: inline-block; width: 6px; height: 14px; background: #ffffff; margin-right: 20px; } .zh-title { margin-left: 30px; padding-top: 30px; font-size: 30px; font-weight: 700; text-align: left; color: #ffffff; line-height: 32px; letter-spacing: 0.3px; font-family: AlibabaPuHuiTiB; } .en-title { margin-left: 30px; font-size: 14px; font-weight: 400; text-align: left; color: #ffffff; line-height: 32px; letter-spacing: -0.91px; font-family: AlibabaPuHuiTiR; }
05-31

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值