/*
* 1602 LCD Sample with ShiftLCD
* https://github.com/Chris--A/ShiftLCD_Fixed
*
* 74HC595-----1602LCD-----ATtiny
*
GND ---- GND
*
VCC ---- 5V
*
VE ---- Variable resistor
* QH ----- RS
*
R/W ----- GND
* QG ----- EN
* QD ----- D4
* QC ----- D5
* QB ----- D6
* QA ----- D7
* QF ----- LED+
*
LED- ----- GND
*
SER
----- D2
*
RCLK
----- D3
*
SRCLK
----- D4
*
*/
// include the library code:
#include <ShiftLCD.h>
// initialize the library with the numbers of the
interface pins
// SerialDataIn, ShiftClock, LatchClock
ShiftLCD lcd(2, 4, 3);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
}
void loop() {
static int number=0;
char buf[21];
if (number < 100) {
lcd.setCursor(0, 0);
// Print a message to the LCD.
sprintf(buf,"Hello, World
%03d!",number++);
lcd.print(buf);
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting
begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis());
}
}
|