over current protection

This commit is contained in:
hg
2014-01-19 00:37:40 +01:00
parent 2609f4c558
commit b43e507daa
7 changed files with 131 additions and 20 deletions

View File

@ -40,9 +40,9 @@ uint16_t stringToUInt8(String i, uint8_t index) {
String MeasureCurrent::exec(String params) {
int currentInVal = analogRead(CURRENT_IN);
int current = currentInVal;
int current = ((double)currentInVal * U_UNIT) / R_SHUNT;
return String() + current;
return String() + current + String("mA");
}