Digistump Forums

The Digispark => Digispark Project Ideas => Topic started by: jaghvi on August 27, 2013, 10:32:22 pm

Title: Digispark as MULTIMETER
Post by: jaghvi on August 27, 2013, 10:32:22 pm
Received 2  Digispark yesterday . How about DS as multimeter ? Anyone who has implemented it ?
Title: Re: Digispark as MULTIMETER
Post by: semicolo on September 01, 2013, 01:35:41 pm
I did a quick voltage logger to eeprom some time ago, it should be fairly easy to display a voltage on a LCD screen.

Title: Re: Digispark as MULTIMETER
Post by: digistump on September 01, 2013, 05:33:44 pm
This should be very simple - and quite useful - for the voltage reading just


int reading = analogRead(PinNumber);
double result = doubleMap(reading,0,1024,0,5);


with this function to do the doubleMap since the map function is just for integers



double doubleMap(double x, double in_min, double in_max, double out_min, double out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}