- Main Page
- Modules
- Data Structures
- Files
- Directories

# Analogic/Digital conversion (ADC)

## Files
file | e_acc.c
| Accessing the accelerometer data.

file | e_acc.h
| Accessing the accelerometer data.

file | e_ad_conv.c
| Module for the advance Analogic/Digital conversion.

file | e_ad_conv.h
| Module for the advance Analogic/Digital conversion.

file | e_micro.c
| Accessing the microphone data.

file | e_micro.h
| Accessing the microphone data.

file | e_prox.c
| Accessing proximity sensor of e-puck.

file | e_prox.h
| Accessing proximity sensor of e-puck.

file | e_accelerometer.c
| Accessing the accelerometer sensor data.

file | e_accelerometer.h
| Accessing the accelerometer sensor data.

file | e_ad_conv.c
| Module for the Analogic/Digital conversion.

file | e_ad_conv.h
| Module for the Analogic/Digital conversion.

file | e_micro.c
| Accessing the microphone data.

file | e_micro.h
| Accessing the microphone data.

file | e_prox.c
| Accessing proximity sensor of e-puck with timer 1.

file | e_prox.h
| Accessing proximity sensor of e-puck with timer 1.

file | e_prox_timer2.c
| Control proximity sensor of e-puck with timer2.

## Detailed Description

## Introduction

The microcontroller p30f6014A has a 12-bit Analog-to-Digital Converter (ADC). This package is built to manage this ADC.
The e-puck has three peripherals which take advantage from it.

- 1 3D accelerometer
- 8 proximity sensors
- 3 microphones

## Package organization

This package is divided by two sub packages:

- The standard approach (files located in the "a_d" folder). This approach uses the timer1 (or timer2) to coordinate the ADC register acquisition.
- The more advanced approach (files located in the "a_d/advance_ad_scan" folder) uses the ADC interrupt to update the four arrays containing all the data of all the peripherals which use the ADC (e_mic_scan for the microphones, e_acc_scan for the accelerometer, e_ambient_ir and e_ambient_and_reflected_ir for the proximity sensors). In this approach, the acquisition is made automatically and always with the same delay. The functions specific to each module (advance_ad_scan/e_acc.c, advance_ad_scan/e_prox.c, advance_ad_scan/e_micro.c) are also more elaborates than the same one in the standard package.

Author:
  Doc: Jonathan Besuchet