Energy calculations in C

Status
Not open for further replies.

P.Copper

Member level 5
Joined
Mar 18, 2013
Messages
82
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,807
Hi all,

I want to do energy calculations in c but i don't understand how to go about defining time in seconds. Can someone show or rather refer me to material where i can define time in seconds. thanks
 

hi set the timer to interrupt for every second and convert the power to 1 sec energy value and add it to already Energy value......
 

simply

Code C - [expand]
1
2
3
4
ISR()   // executes every 1 sec
{
   Energy += power / 3600;      // if power in kwatts then energy in kwh and also declare both of them in float
}

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…