diff --git a/src/es/pin/pin-3.md b/src/es/pin/pin-3.md index b53cb4d..09fd271 100644 --- a/src/es/pin/pin-3.md +++ b/src/es/pin/pin-3.md @@ -1,25 +1 @@ SDA es uno de los pines i2c en la Pi, [aprende más sobre i2c](/pinout/i2c). - -Es fácil escribir un HIGH (encendido) o LOW (apagado) digital a un pin del GPIO, pero debes recordar algunas cosas: - -* Ejecuta tus programas como root -* Ajusta el modo de los pines a OUTPUT (1) - -Asumiendo que has instalado WiringPi2-Python ( pip install wiringpi2 ) prueba a pegar lo siguiente en un archivo .py: - -```python -import wiringpi2 as wiringpi -HIGH = 1 -LOW = 0 -OUTPUT = 1 -INPUT = 0 -wiringpi.wiringPiSetup() -wiringpi.pinMode(8,OUTPUT) -wiringpi.digitalWrite(8,HIGH) -``` - -Ejecútalo con: - -```bash -sudo python myscript.py -``` diff --git a/src/fr/pin/pin-3.md b/src/fr/pin/pin-3.md index be3a614..f90fd99 100644 --- a/src/fr/pin/pin-3.md +++ b/src/fr/pin/pin-3.md @@ -1,25 +1 @@ SDA est la broche fournissant le signal de données du bus i2c de la Raspberry Pi, [référence i2c](/pinout/i2c). - -Conseil: Il est aisé de basculer une broche de l'état haut (HIGH) vers l'état bas (LOW), ou vice versa, mais prenez cependant quelques précautions: - -* Exécutez vos scripts en invoquant l'utilisateur 'root' -* n'oubliez pas de déclarer la broche en tant que sortie (OUTPUT, 1) - -Par exemple, sous WiringPi2-Python ( pip install wiringpi2 ): - -```python -import wiringpi2 as wiringpi -HIGH = 1 -LOW = 0 -OUTPUT = 1 -INPUT = 0 -wiringpi.wiringPiSetup() -wiringpi.pinMode(8,OUTPUT) -wiringpi.digitalWrite(8,HIGH) -``` - -Puis: - -```bash -sudo python myscript.py -``` \ No newline at end of file diff --git a/src/it/pin/pin-3.md b/src/it/pin/pin-3.md index ab2faea..ff9d0c3 100644 --- a/src/it/pin/pin-3.md +++ b/src/it/pin/pin-3.md @@ -1,6 +1 @@ SDA è uno dei pin i2c del Raspberry, [maggiori informazioni su i2c](/pinout/i2c). - -È facile muovere i primi passi scrivendo un HIGH o LOW digitale su un pin GPIO, ma devi ricordarti un paio di cose: - -* Lancia il tuo script come root -* Imposta la modalità del tuo pin ad OUTPUT (1) diff --git a/src/tr/pin/pin-3.md b/src/tr/pin/pin-3.md index 78ff085..fcde481 100644 --- a/src/tr/pin/pin-3.md +++ b/src/tr/pin/pin-3.md @@ -1,25 +1 @@ SDA, Raspberry Pi'deki I2C pinlerinden biri. [I2c hakkında detaylı bilgi](/pinout/i2c). - -GPIO pinleri ile dijital HIGH ve LOW değerlerini okumak ve hazırlamak oldukça kolay, yalnız bazı hususlara dikkat etmeniz gerekmekte: - -* Kodu çalıştıracak script'inizi root (süper yönetici) hakları ile çalıştırmalısınız. -* Pin'in modunu OUTPUT (1) olarak tanımlamalısınız. - -Eğer WiringPi2-Pytgon kütüphanesini kurduysanız ( pip install wiringpi2 ) o zaman aşağıdaki kodu bir .py dosyası olarak kaydedip çalıştırabilirsiniz: - -```python -import wiringpi2 as wiringpi -HIGH = 1 -LOW = 0 -OUTPUT = 1 -INPUT = 0 -wiringpi.wiringPiSetup() -wiringpi.pinMode(8,OUTPUT) -wiringpi.digitalWrite(8,HIGH) -``` - -Ardından şu komutla çalıştırabilirsiniz: - -```bash -sudo python scriptadi.py -``` \ No newline at end of file