当前位置:网站首页>Abnormal analysis of pcf8591 voltage measurement data
Abnormal analysis of pcf8591 voltage measurement data
2022-06-27 14:22:00 【Old man in charge】
Problem description : after ad After the transformation , Convert data into voltage value , And display the voltage value on the nixie tube . But the nixie tube can display 5.44.
Problem analysis : In general , I think it's the error from integer to floating point , But when you think about it, it shouldn't exist in two decimal places .
Problem solving : After a long time of thinking , I found that the data may have overflowed :
// The data I define is unsigned char
// The biggest data received is 255
// Because the decimal number should be displayed on the nixie tube , So I enlarged the data 100 times , The data processing is as follows
unsigned char dat_in;
smg_set(0,0,0,0,0,dat_in/51,(dat_in*100/51)%100/10,(dat_in*100)/51%10);
// It's not hard to find out , Most likely in (dat_in*100)/51 Overflow occurred in the process of So the solution is to change to unsigned int Slightly .
beautiful !!! Clean and hygienic oh !!!!
边栏推荐
- Summary and Thinking on interface test automation
- Practice of constructing ten billion relationship knowledge map based on Nebula graph
- Resolve activity startup - lifecycle Perspective
- AXI總線
- SFINAE
- What kind of experience is it to read other people's code
- Calcul de la confidentialité Fate - Prévisions hors ligne
- Bidding announcement: Oracle all-in-one machine software and hardware maintenance project of Shanghai R & D Public Service Platform Management Center
- Too many requests at once, and the database is in danger
- 机械硬盘和ssd固态硬盘的原理对比分析
猜你喜欢

一次性彻底解决 Web 工程中文乱码问题

Buuctf Misc

线程同步之信号量

Number of printouts (solved by recursive method)

【业务安全-01】业务安全概述及测试流程

SFINAE
![[business security-04] universal user name and universal password experiment](/img/09/73d8356d00cefb6d1af086669f69ff.png)
[business security-04] universal user name and universal password experiment

enable_if

PostgreSQL 15新版本特性解读(含直播问答、PPT资料汇总)

The global chip market may stagnate, and China's chip expansion accelerates to improve its self-sufficiency rate against the trend
随机推荐
海外仓知识科普
CMOS级电路分析
Resolve activity startup - lifecycle Perspective
my.ini文件配置
优雅的自定义 ThreadPoolExecutor 线程池
[xman2018 qualifying] pass
解析Activity启动-生命周期角度
Why must Oracle cloud customers self test after the release of Oracle cloud quarterly update?
易周金融 | Q1手机银行活跃用户规模6.5亿;理财子公司布局新兴领域
为什么 Oracle 云客户必须在Oracle Cloud 季度更新发布后自行测试?
Brief reading of dynamic networks and conditional computing papers and code collection
Pytorch learning 1 (learning documents on the official website)
Pycharm安装与设置
现在开户有优惠吗?网上开户是否安全么?
How to select cross-border e-commerce multi merchant system
Redis持久化
Nvidia Deepstream 运行延迟,卡顿,死机处理办法
美国芯片再遭重击,继Intel后又一家芯片企业将被中国芯片超越
Half find (half find)
Privacy computing fat offline prediction