Modifications

Sauter à la navigation Sauter à la recherche
101 octets ajoutés ,  15 août 2016 à 14:51
Ligne 7 : Ligne 7 :  
{{ADFImage|RASP-PYGAME-GUI-Analogique-00.jpg}}
 
{{ADFImage|RASP-PYGAME-GUI-Analogique-00.jpg}}
   −
This example uses a 10K potentiometer to provide a varying voltage. For analog to digital I normally use an [http://jeremyblythe.blogspot.co.uk/2012/09/raspberry-pi-hardware-spi-analog-inputs.html MCP3008 over SPI]. That's not possible here though because the PiTFT uses both SPI channels on the Pi. So I've switched to an I2C ADC: [http://www.adafruit.com/product/1085 ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier].
+
Cet exemple utilise un potentiomètre de 10K pour fournir une tension variable. Pour la conversion analogique vers digital nous utilisons habituellement un [http://jeremyblythe.blogspot.co.uk/2012/09/raspberry-pi-hardware-spi-analog-inputs.html MCP3008 via SPI]. Mais cela n'est pas possible ici puisque le PiTFT utilise les deux canaux SPI disponibles sur le Pi. Par conséquant, nous optons pour un convertisseur ADC I2C: [http://www.adafruit.com/product/1085 ADC 16-Bit ADS1115 - 4 canaux avec un gain programmable].
   −
Get the Adafruit Python library:
+
Pour obtenir la bibliothèque Python Adafruit:
    
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Ligne 16 : Ligne 16 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
If you need to enable i2c follow this guide: [[Rasp-Hack-GPIO_Configurer_I2C|Configuring I2C]]
+
Vous aurez besoin d'activer  [[Rasp-Hack-GPIO_Configurer_I2C|le support I2C en suivant ce guide]]
    
{{ADFImage|RASP-PYGAME-GUI-Analogique-01.jpg}}
 
{{ADFImage|RASP-PYGAME-GUI-Analogique-01.jpg}}
29 923

modifications

Menu de navigation