UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

TA12200 Class

Module: ta12200

UPM module for the TA12-200 current transformer found, for instance, in the Grove Electricity Sensor. This module can measure AC moving through a wire at up to 5 A.
ta12200.jpg

Methods

TA12200

(
  • pin
)
Number

TA12200 constructor

Parameters:

  • pin Number

    Analog pin to use

Returns:

Number:

getMillis

() Number

Returns the number of milliseconds elapsed since initClock() was last called.

Returns:

Number:

Elapsed milliseconds

initClock

()

Resets the clock

highestValue

() Number

Gets the conversion value from the sensor

Returns:

Number:

Highest value obtained over 1 second of measuring or -1 if error

milliAmps

(
  • val
  • res
)
Number

Computes the measured voltage

Parameters:

  • val Number

    Value measured by highestValue()

  • res Number

    ADC resolution

Returns:

Number:

Measured current in mA