[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4752: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4754: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4755: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
MS-Robot • Consulter le sujet - 10 Channel Analog to Digital Converter (ADC) I2C

Nous sommes actuellement le Dim Sep 15, 2019 11:56 am
Publier un nouveau sujetPublier une réponse Page 1 sur 1   [ 1 message ]
Auteur Message
Message Publié : Jeu Oct 17, 2013 7:48 am 
Avatar de l’utilisateur

Inscription : Ven Mai 24, 2013 9:58 am
Message(s) : 26
Many microcontroller projects involve the use of sensors like Accelerometers, Gyroscopes, Temperature, Compass, Barometric, Current, Proximity and others. Some sensors have I2C or SPI interfaces but there are still a great many which produce an analogue output voltage. These are measured with the use of the built-in Analogue to Digital Converters (ADC) included in microcontrollers. However, if you are using many sensors and don’t have enough ADC inputs, or have used those pins for other functions, you either have to upgrade to a larger microcontroller with more inputs or resort to using an external (and expensive) ADC chip.

With this in mind we have programmed our own microcontroller to provide you with 10 additional ADC inputs available via I2C as a slave device.

No additional components are required as it has its own built in oscillator clock circuit.

10 ADC input channels, each with 10 bit resolution (AN0 through AN9)
I2C interface
Configurable Slave Address between 40 and 47 allows up to 8 units to be added to your project
64MHz Clock Speed
ADC values are measured 1000 times per second (1 kHz)
Selectable Complementary Filter function
Selectable 10-bit (2 bytes per ADC) or 8-bit (1 byte per ADC) output
Heartbeat output to show unit is functioning
5V or 3.3V operation
Each ADC input is read 3 times and the average value taken to reduce spurious values
ADC to I2C Chip Pinout



Documents



Example Programs

For Arduino example code, check out the datasheet linked to above.

Here is an example reading the ADC chip using Python on a Raspberry Pi. It reads the 10 ADC channels at 8-bit (10 bytes returned), then at 10-bit (20 bytes returned), and prints the results.

import smbus
import time

bus = smbus.SMBus(0)

results8 = []
results10 = []

bus.write_byte(0x28, 0x01)
time.sleep(0.1)
results8 = bus.read_i2c_block_data(0x28, 0x01, 0x0A)
print results8

bus.write_byte(0x28, 0x00)
time.sleep(0.1)
results10 = bus.read_i2c_block_data(0x28, 0x00, 0x14)
print results10


Haut
Hors-ligneProfil
Afficher les messages publiés depuis :  Trier par  
Publier un nouveau sujetPublier une réponse Page 1 sur 1   [ 1 message ]


Qui est en ligne ?

Utilisateur(s) parcourant ce forum : Aucun utilisateur inscrit et 1 invité


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Recherche de :
Aller vers :  
cron

Propulsé par phpBB® Forum Software © phpBB Group
Code Black-Bird © 2011-2012 by FanFanLaTuFlippe
Traduction et support en françaisHébergement phpBB