WOLFRAM SYSTEM MODELER

AnalogInput

Reads an analog signal from the specified pin

Wolfram Language

In[1]:=
SystemModel["ModelPlug.Pins.AnalogInput"]
Out[1]:=

Information

Reads an analog signal from the specified pin. This component uses the 'analogRead' function of the Arduino.

Signal Range: By default, the signal goes from 0 to 1 where 0 represents no voltage and 1 the voltage reference of the ADC in the board. This signal can be scaled by setting the 'MinValue' and 'MaxValue' parameters.

Not all pins support analog input. Check the documentation of your board to find the pin capabilities.

Parameters (4)

Pin

Value: 0

Type: Integer

Description: Number of the analog pin

InitValue

Value: 0

Type: Real

Description: Initial value until the board responds

MinValue

Value: 0

Type: Real

Description: Minimum value when the ADC reads 0

MaxValue

Value: 1

Type: Real

Description: Maximum value when the ADC reads 1024

Connectors (2)

y

Type: RealOutput

Description: 'output Real' as connector

pinConnector

Type: PinConnector

Used in Examples (2)

ReadSensor

ModelPlug.Examples

Reading analog signals

SimpleONOFF

ModelPlug.Examples

A simple On/Off controller