Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Energy calculations in C

Status
Not open for further replies.

P.Copper

Member level 5
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top