Shield LCD + boutons
Carte compléte avec un LCD 2 lignes 16 caractères et 6 Boutons poussoirs
Connexion SSL et possibilité de régler par Paypal
Livraison offerte dès 100€ d'achat
Une question? On vous répond par mail et téléphone
Shield LCD + boutons
DESCRIPTION
Cette carte comprend un LCD 2 lignes 16 caractères et 6 Boutons poussoirs.
Compatible Rasberry Pi et Arduino
CARACTERISTIQUES TECHNIQUES
- 2 lignes
- 16 caractères
- 6 Boutons
- Potentiométre pour régler le contraste
- Caractère blanc sur fond bleu
- Se plug en direct sur une carte Arduino Uno
Configuration:
- LCD RS -> Digital pin 8
- LCD Enable -> Digital pin 9
- LCD D4 -> Digital pin 4
- LCD D5 -> Digital pin 5
- LCD D6 -> Digital pin 6
- LCD D7 -> Digital pin 7
- LCD BL -> Digital pin 10
- Key pin -> Analogpin A0
TUTORIELS / LIENS
- Fichier 3D du shield: https://grabcad.com/library/lcd-keypad-shield
- Tutoriel avec Arduino: https://letmeknow.fr/blog/2013/08/21/tuto-utiliser-un-shield-lcd/
Exemple de programme Arduino:
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
char msgs[5][16] = {"Right Key OK ",
"Up Key OK ",
"Down Key OK ",
"Left Key OK ",
"Select Key OK" };int adc_key_val[5] ={50, 200, 400, 600, 800 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;void setup()
{
lcd.clear();
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print("ADC key testing");
}void loop()
{
adc_key_in = analogRead(0); // read the value from the sensor
key = get_key(adc_key_in); // convert into key press
if (key != oldkey) // if keypress is detected
{
delay(50); // wait for debounce time
adc_key_in = analogRead(0); // read the value from the sensor
key = get_key(adc_key_in); // convert into key press
if (key != oldkey)
{
lcd.setCursor(0, 1);
oldkey = key;
if (key >=0){
lcd.print(msgs[key]);
}
}
}
delay(100);
}// Convert ADC value to key number
int get_key(unsigned int input)
{
int k;
for (k = 0; k < NUM_KEYS; k++)
{
if (input < adc_key_val[k])
{
return k;
}
}
if (k >= NUM_KEYS)k = -1; // No valid key pressed
return k;
}