制造商零件编号 LCM-S01602DSR/A
LCD MOD 32 DIG 16 X 2 REFLECTIVE
Lumex Opto/Components Inc.
所订产品一般在 7-10个工作日 内送达中国,具体时间取决于收货地点。
最低订购金额为人民币 300 元,顺丰快递免运费配送。
当用人民币下单时,按照国际贸易条款 DDP(DigiKey 支付关税、海关费用和当地税款)方式结算。
电汇预付
更多来自全授权合作伙伴的产品
下单后,从合作伙伴发货平均需要时间 1-3 天,也可能产生额外运费。可能另外收取运费。 实际发货时间请留意产品详情页、购物车和结账页面上的说明。
国际贸易结算方式:CPT(交货时支付关税、海关费用和适用 VAT/应付税金)
有关详情,请访问帮助和支持
License: General Public License Arduino
Courtesy of All About Circuits
Learn to create a user interface by pairing an Arduino with an LCD and then display a counter.
Today we’ll go over how to hookup an LCD screen to an Arduino and then how to enter a command to display on your LCD screen.
In step one, we’ll interface the Arduino with an LCD.
In step two, we’ll set up a counter to display on our new LCD setup.
Here’s what you’ll specifically need to follow along with this tutorial:
Get to Know Your LCD
Liquid crystal display (LCD) screens are by far the most popular screens for electronics today. If you look around you, you’re likely to see at least one or two, possibly on your microwave or landline caller ID box.
Your LCD has a total of 16 pins. Here’s what each pin is designed to do:
Pins 1 and 16: These are your power and ground.
Pin 3: Used to adjust the brightness of the LCD.
Pins 4-6: Used to operate the LCD.
Pins 7-14: Used as data lines.
Pins 15-16: Used to power the LCD’s backlight.
Accordingly, here’s a table to demonstrate how we’ll want to connect the LCD to the rest of the project:
Step 1: Connect Your LCD to Your Arduino
First we’ll need to connect your LCD pins to the Arduino pins.
Here’s a table to help:
Your potentiometer should connect via its two outer terminals to 5V and to GND. The middle terminal should connect to pin 3 on your LCD. By connecting it this way, your potentiometer can now be rotated to control how bright the backlight of your LCD is.
Code:
To run your LCD off of your Arduino, input the following code:
#include "LiquidCrystal.h"
// initialize the library by providing the nuber of pins to it
LiquidCrystal lcd(8,9,4,5,6,7);
void setup() {
lcd.begin(16,2);
// set cursor position to start of first line on the LCD
lcd.setCursor(0,0);
//text to print
lcd.print(" 16x2 LCD");
// set cusor position to start of next line
lcd.setCursor(0,1);
lcd.print(" DISPLAY");
}
void loop()
{}
For this part, our goal is to set up a counter. The Arduino will count up to a value of 100, ticking up once per second.
Code:
To display the counter on your LCD, input the following code:
#include "LiquidCrystal.h"
// initialize the library by providing the nuber of pins to it
LiquidCrystal lcd(8,9,4,5,6,7);
void setup() {
lcd.begin(16,2);
// set cursor position to start of first line on the LCD
lcd.setCursor(0,0);
//text to print
lcd.print(" COUNTER");
delay(100);
int a=0;
lcd.setCursor(0,1);
lcd.print(" ");
lcd.print(a);
while(a<=100)
{
a=a 1;
delay(1000);
lcd.setCursor(0,1);
lcd.print(" ");
lcd.print(a);
}
}
void loop()
{
lcd.clear();
}
You should now have a successful interface between your Arduino and your LCD. On top of that, you should also be able to run a counter on your LCD screen. Good luck!
谢谢!
敬请关注收件箱中的 DigiKey 新闻与更新!
请输入电子邮件地址