pic24_dspic33::analog_input Class Reference

This class provides basic analog input for the PIC. More...

List of all members.

Public Member Functions

def __init__
 Create the class for a specific analog pin, numbered ANxx on the data sheet.
def getCode
 Read the code produced by the ADC, a value from 0 to 4095 which is linearly proportional to the input voltage.
def getVoltage
 Read the voltage produced by the ADC, resulting in a returned value between 0 and 3.3V.
def getNorm
 Read the voltage produced by the ADC, resulting in a normalized value ranging from 0 to 1.


Detailed Description

This class provides basic analog input for the PIC.

Configuring a given pin overrides any previous configuration (as a digital input, other digital I/O, peripheral such as UART, SPI, etc.)

Definition at line 98 of file pic24_dspic33.py.


Member Function Documentation

def pic24_dspic33::analog_input::__init__ (   self,
  analogPin 
)

Create the class for a specific analog pin, numbered ANxx on the data sheet.

Configures the pin as an analog input.

Parameters:
analogPin Pin to configure.
__NATIVE__
return configAnalogPinPy(ppframe);

Definition at line 102 of file pic24_dspic33.py.

def pic24_dspic33::analog_input::getCode (   self  ) 

Read the code produced by the ADC, a value from 0 to 4095 which is linearly proportional to the input voltage.

__NATIVE__
return readAnalogCodePy(ppframe);

Definition at line 110 of file pic24_dspic33.py.

def pic24_dspic33::analog_input::getNorm (   self  ) 

Read the voltage produced by the ADC, resulting in a normalized value ranging from 0 to 1.

__NATIVE__
return readAnalogFloatPy(ppframe, 1.0/4096.0);

Definition at line 126 of file pic24_dspic33.py.

def pic24_dspic33::analog_input::getVoltage (   self  ) 

Read the voltage produced by the ADC, resulting in a returned value between 0 and 3.3V.

__NATIVE__
return readAnalogFloatPy(ppframe, 3.3/4096.0);

Definition at line 118 of file pic24_dspic33.py.


The documentation for this class was generated from the following file:

Generated on Mon Oct 18 07:40:50 2010 for Python-on-a-chip by  doxygen 1.5.9