int sensorMv = analogRead(0); sensorMv = constrain(sensorMv, sensorCal, 1023); //set sensorCal to min value sensorMv = map(sensorMv, sensorCal, 1023, 0, maxamp); //set sensorCal to 0 amps, then 1023-sensorCal is range, divided by 40mV per amp or 8.16units per amp int pin3 = analogRead(3); //all the pin3 stuff is testing code, using a pot to mimic the sensor pin3 = constrain(pin3, sensorCal, 1023); pin3 = map(pin3, sensorCal, 1023, 0, maxamp); int sensorOut = analogRead(0) * 4.9; //quick conversion to mV from the sensor
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16