在LCD上实现成本/每次代码(C编程) [英] Implementing a cost/per time code on an LCD (C programming)
本文介绍了在LCD上实现成本/每次代码(C编程)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在设计一个成本计算系统,它测量某人在公园的时间,而不是计算总成本(每分钟0.10美元)。我不是试图在液晶屏上显示它。这是在C编程中,我仍然试图使用计时器。任何帮助将不胜感激
我尝试过:
我我可以将数据移动到LCD屏幕上。但是,我不知道在尝试测量时间并乘以它时从哪里开始。
Hi,
I am trying to design a costing system, which measures the time somebody is in a park and than calculates the total cost say ($0.10 per minute). I am than trying to display this on an LCD screen. This is in C programming and am still trying to get my head around using timers. Any help would be appreciated
What I have tried:
I am okay at moving data onto the LCD screen. However, I do not know where to start when trying to take a measured time and multiply it.
推荐答案
每分钟0.10)。我不是试图在液晶屏上显示它。这是在C编程中,我仍然试图使用计时器。任何帮助将不胜感激
我尝试过:
我我可以将数据移动到LCD屏幕上。但是,我不知道在尝试测量时间并乘以它时从哪里开始。
0.10 per minute). I am than trying to display this on an LCD screen. This is in C programming and am still trying to get my head around using timers. Any help would be appreciated
What I have tried:
I am okay at moving data onto the LCD screen. However, I do not know where to start when trying to take a measured time and multiply it.
捕获活动开始和结束时的时间,然后计算差异:
Capture the time at the start and end of the activity, and then calculate the difference:
time_t timeStart = time();
// do the activities
time_t timeEnd = time();
long seconds = timeEnd - timeStart;
参见 time,_time32,_time64 [ ^ ]。
这篇关于在LCD上实现成本/每次代码(C编程)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文