1

I pretty new to the Arduino. I am working on project that find the power by reading your

closed as off-topic by Juraj, VE7JRO, sempaiscuba, MatsK, gre_gor Feb 19 at 19:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Arduino, within the scope defined in the help center." – Juraj, VE7JRO, sempaiscuba, MatsK, gre_gor
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Why would you want to subtract it? Do you maybe want to sum / integrate it over time to get total energy consumption? – Maximilian Gerhardt Feb 18 at 19:47
  • I have this fourmal S=(V2-V1)/(P2-P1) – Abdulrahman Feb 18 at 19:54
  • I have no idea what S is supposed to express here. But in the code you can take two measurements in predifened interval and then compute S. – Maximilian Gerhardt Feb 18 at 20:09
  • S means the voltage sensitivity. Can you express what you said in code? – Abdulrahman Feb 18 at 20:31
  • you do it by coding the sketch. – Juraj Feb 19 at 6:13
0

I think you need something like the following :

int lastTime;

void loop(){
  int thisTime = analogRead(A1);
  int diff = thisTime - lastTime;
  lastTime = thisTime;
  Serial.println(diff);
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.