Toll-Free Customer Support 24/7

LCD KEYPAD Shield-Serial

One of the basic interfacing requirements for the hobbyists or electronics enthusiasts is I/P (keypad) and O/P (LCD display)  for proyotype applications. This shield uses minimum number I/O’s that is 2 bits(D0 and D1) for LCD data . 5 input key switches (Navigation keys), when it's activated serial data will be sent to pin  D0 by internal 2 line LCD controller. Each key has been pulled up to a different voltage level, so a different voltage will be generated every time a user selects a key. This voltage could be read by the analog pin of internal 2 line LCD controller on the board. Hence saves the no of I/O pins.  The backlight of the LCD could be controlled by setting PWM (Pin D10) by adding a few lines of code.

Order Code : RDL/LKS/14/001/V1.0

Posted by Vinod, Friday, 6 March 2015 on product LCD KEYPAD Shield-Serial
  • 0
    vote
    A:

    Dear Mr.Vinod

    Please find the code below

    int TrigPin = 5;
    int EchoPin = 6;
    void setup()
    {
    Serial.begin(9600);
    pinMode(TrigPin,OUTPUT);
    pinMode(EchoPin,INPUT);
    }
    void loop()
    {
    float distance,duration;
    float cd;
    digitalWrite(TrigPin,HIGH);//TrigPin prepare high of more than 10us
    delayMicroseconds(11);
    digitalWrite(TrigPin,LOW);

    duration = pulseIn(EchoPin, HIGH);//EchoPin received high start counting until the receiver to the low,return to the count valu
    duration =duration/29/2;//Calculating the distance cm
    // The speed of s ound is 340 m/s or 29 microseconds per centimeter.
    // cd=duration/10;
    Serial.write(byte(0X01));
    Serial.write(byte(0X80));
    Serial.print("-DISTANCE-");
    Serial.write(byte(0XC0));
    Serial.print(duration);//Serial display distance
    Serial.print("cm");
    delay(1000);
    }

     

     

    int TrigPin = 5;
    int EchoPin = 6;
    void setup()
    {
    Serial.begin(9600);
    pinMode(TrigPin,OUTPUT);
    pinMode(EchoPin,INPUT);
    }
    void loop()
    {
    float distance,duration;
    float cd;
    digitalWrite(TrigPin,HIGH);//TrigPin prepare high of more than 10us
    delayMicroseconds(11);
    digitalWrite(TrigPin,LOW);

    duration = pulseIn(EchoPin, HIGH);//EchoPin received high start counting until the receiver to the low,return to the count valu
    duration =duration/29/2;//Calculating the distance cm
    // The speed of s ound is 340 m/s or 29 microseconds per centimeter.
    // cd=duration/10;
    Serial.write(byte(0X01));
    Serial.write(byte(0X80));
    Serial.print("-DISTANCE-");
    Serial.write(byte(0XC0));
    Serial.print(duration);//Serial display distance
    Serial.print("cm");
    delay(1000);
    }

    Posted by Dipti Divakar on Friday, 6 March 2015

Ask Your Question

  • Reload captcha

* Required Fields

Back to top