la bibliothéque LiquidCrystal en python
Répondre à la discussion
Affichage des résultats 1 à 2 sur 2

la bibliothéque LiquidCrystal en python



  1. #1
    invite3eceeb86

    la bibliothéque LiquidCrystal en python


    ------

    Bonjour
    j'ai écrit le programme arduino suivant, je veux le transformer en code python. j'aimerais bien savoir si la bibliotheque LiquidCrystal existe en python? et comment l'importer. merciiii beaucoup d'avance (je suis un débutant en arduino )
    Code:
    // include the library code:
    #include <LiquidCrystal.h>
    
    // initialize the library with the numbers of the interface pins
    LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
    
    const byte TRIGGER=6;   
    const byte ECHO=7;   
    const float vitesse_du_son=34; 
    
    void setup() {
      // set up the LCD's number of columns and rows: 
      lcd.begin(16, 2);
      Serial.begin(9600);
    pinMode(8,OUTPUT);
    digitalWrite(8,LOW);
    pinMode(9,OUTPUT);
    digitalWrite(9,HIGH);
    pinMode(TRIGGER,OUTPUT);
    digitalWrite(TRIGGER,LOW);
    pinMode(ECHO,INPUT);
    
    
      
    }
    
    
    void loop() {
      digitalWrite(TRIGGER,HIGH);
    delayMicroseconds(10);
    digitalWrite(TRIGGER,LOW);
    long mesure=pulseIn(ECHO,HIGH);            
    float distance_cm=mesure/(2.0*1000)*vitesse_du_son;
    
       lcd.setCursor(0,0);
      // Print a message to the LCD.
      lcd.print("the distance is:"); 
      lcd.setCursor(0,1);
      
      lcd.print(distance_cm);
        lcd.print("      cm");
      lcd.noDisplay();
      delay(500);
      lcd.display();
      delay(500);
    }

    -----

  2. #2
    polo974

    Re : la bibliothéque LiquidCrystal en python

    google(LiquidCrystal)

    This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset
    google(python HD44780)

    à toi de fouiller pour la suite...
    Jusqu'ici tout va bien...

Discussions similaires

  1. [Analogique] bibliothèque CCS TCP/IP
    Par invite857acf1e dans le forum Électronique
    Réponses: 3
    Dernier message: 15/05/2018, 18h26
  2. [Python] Problème de lag de programme et essai de Timer python
    Par Loupsio dans le forum Programmation et langages, Algorithmique
    Réponses: 20
    Dernier message: 26/01/2018, 15h14
  3. Afficher les valeurs d'un vol en graphique avec une bibliotheque python
    Par invite7f2b82eb dans le forum Programmation et langages, Algorithmique
    Réponses: 1
    Dernier message: 15/05/2017, 09h40
  4. [Python] subprocess, lancer un autre programme avec python
    Par Loupsio dans le forum Programmation et langages, Algorithmique
    Réponses: 10
    Dernier message: 30/11/2016, 18h56
  5. en python le multi tache n'est pas possible alors pourquoi les threads existent sur python?
    Par docEmmettBrown dans le forum Programmation et langages, Algorithmique
    Réponses: 5
    Dernier message: 10/06/2015, 15h47