mirror of
https://github.com/zyphlar/open-access-control-minimal-http.git
synced 2024-03-08 15:57:47 +00:00
Updated readme; removed shiftlcd examples
This commit is contained in:
parent
2131207c09
commit
02435a78b1
|
@ -12,6 +12,10 @@ Structure
|
|||
* Open Access Control folder
|
||||
* Open Access Control.pde (Arduino code -- open from the Arduino IDE.)
|
||||
* libraries folder (copy the contents of this folder to your Arduino program's libraries folder.)
|
||||
* ShiftLCD folder
|
||||
* keywords.txt
|
||||
* ShiftLCD.cpp
|
||||
* ShiftLCD.h
|
||||
* PCATTACH folder
|
||||
* keywords.txt
|
||||
* PCATTACH.cpp
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - Autoscroll
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch demonstrates the use of the autoscroll()
|
||||
and noAutoscroll() functions.
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of columns and rows:
|
||||
lcd.begin(16,2);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// set the cursor to (0,0):
|
||||
lcd.setCursor(0, 0);
|
||||
// print from 0 to 9:
|
||||
for (int thisChar = 0; thisChar < 10; thisChar++) {
|
||||
lcd.print(thisChar);
|
||||
delay(500);
|
||||
}
|
||||
|
||||
// set the cursor to (16,1):
|
||||
lcd.setCursor(16,1);
|
||||
// set the display to automatically scroll:
|
||||
lcd.autoscroll();
|
||||
// print from 0 to 9:
|
||||
for (int thisChar = 0; thisChar < 10; thisChar++) {
|
||||
lcd.print(thisChar);
|
||||
delay(500);
|
||||
}
|
||||
// turn off automatic scrolling
|
||||
lcd.noAutoscroll();
|
||||
|
||||
// clear screen for the next loop:
|
||||
lcd.clear();
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - Backlight
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch displays "Hello, World!" and then flashes the display
|
||||
on and off once a second
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
Example by
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initalise the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2,4,3);
|
||||
|
||||
void setup()
|
||||
{
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16,2);
|
||||
// Output Hello, World!
|
||||
lcd.print("Hello, World!");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// Turn the backlight on
|
||||
lcd.backlightOn();
|
||||
delay(1000);
|
||||
// Turn the backlight off
|
||||
lcd.backlightOff();
|
||||
delay(1000);
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - Blink
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch prints "Hello World!" and makes the cursor blink
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2,4,3);
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16, 2);
|
||||
// Print a message to the LCD.
|
||||
lcd.print("hello, world!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Turn off the blinking cursor:
|
||||
lcd.noBlink();
|
||||
delay(3000);
|
||||
// Turn on the blinking cursor:
|
||||
lcd.blink();
|
||||
delay(3000);
|
||||
}
|
||||
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - CreateChar
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch prints "Hello, World!" and then adds a smiley after it
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
Example based on the code from the arduino.cc reference library for LiquidCrystal
|
||||
Chris Parish, January 17th 2010
|
||||
|
||||
*/
|
||||
|
||||
//include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initalise the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2,4,3);
|
||||
|
||||
//define the smiley
|
||||
byte smiley[8] = {
|
||||
B00000,
|
||||
B10001,
|
||||
B00000,
|
||||
B00000,
|
||||
B10001,
|
||||
B01110,
|
||||
B00000,
|
||||
};
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
// create the character. This must be done before calling lcd.begin
|
||||
lcd.createChar(0, smiley);
|
||||
// initalise the display with the number of row and colums:
|
||||
lcd.begin(16,2);
|
||||
// output Hello World to the display:
|
||||
lcd.print("Hello, World!");
|
||||
// output the custom character:
|
||||
lcd.write(0);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - Cursor
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch prints "Hello World!" to the LCD and
|
||||
uses the cursor() and noCursor() methods to turn
|
||||
on and off the cursor.
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16, 2);
|
||||
// Print a message to the LCD.
|
||||
lcd.print("hello, world!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Turn off the cursor:
|
||||
lcd.noCursor();
|
||||
delay(500);
|
||||
// Turn on the cursor:
|
||||
lcd.cursor();
|
||||
delay(500);
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - Display
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch prints "Hello World!" to the LCD and uses the
|
||||
display() and noDisplay() functions to turn on and off
|
||||
the display.
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16, 2);
|
||||
// Print a message to the LCD.
|
||||
lcd.print("hello, world!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Turn off the display:
|
||||
lcd.noDisplay();
|
||||
delay(500);
|
||||
// Turn on the display:
|
||||
lcd.display();
|
||||
delay(500);
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - Hello World
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch prints "Hello World!" to the LCD
|
||||
and shows the time.
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16, 2);
|
||||
// Print a message to the LCD.
|
||||
lcd.print("Hello, World!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// 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()/1000);
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - Scroll
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch prints "Hello World!" to the LCD and uses the
|
||||
scrollDisplayLeft() and scrollDisplayRight() methods to scroll
|
||||
the text.
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16, 2);
|
||||
lcd.setCursor(0,7);
|
||||
// Print a message to the LCD.
|
||||
lcd.print("hello, world!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// scroll 27 positions (display length + string length) to the left:
|
||||
for (int positionCounter = 0; positionCounter < 27; positionCounter++) {
|
||||
// scroll one position left:
|
||||
lcd.scrollDisplayLeft();
|
||||
// wait a bit:
|
||||
delay(200);
|
||||
}
|
||||
|
||||
// scroll 27 positions (display length + string length) to the right:
|
||||
for (int positionCounter = 0; positionCounter < 27; positionCounter++) {
|
||||
// scroll one position right:
|
||||
lcd.scrollDisplayRight();
|
||||
// wait a bit:
|
||||
delay(200);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - SerialDisplay
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch displays text sent over the serial port
|
||||
(e.g. from the Serial Monitor) on an attached LCD.
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
void setup(){
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16, 2);
|
||||
// initialize the serial communications:
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// when characters arrive over the serial port...
|
||||
if (Serial.available()) {
|
||||
// wait a bit for the entire message to arrive
|
||||
delay(100);
|
||||
// clear the screen
|
||||
lcd.clear();
|
||||
// read all the available characters
|
||||
while (Serial.available() > 0) {
|
||||
// display each character to the LCD
|
||||
lcd.write(Serial.read());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - TextDirection
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch demonstrates how to use leftToRight() and rightToLeft()
|
||||
to move the cursor.
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
int thisChar = 'a';
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(16, 2);
|
||||
// turn on the cursor:
|
||||
lcd.cursor();
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// reverse directions at 'm':
|
||||
if (thisChar == 'm') {
|
||||
// go right for the next letter
|
||||
lcd.rightToLeft();
|
||||
}
|
||||
// reverse again at 's':
|
||||
if (thisChar == 's') {
|
||||
// go left for the next letter
|
||||
lcd.leftToRight();
|
||||
}
|
||||
// reset at 'z':
|
||||
if (thisChar > 'z') {
|
||||
// go to (0,0):
|
||||
lcd.home();
|
||||
// start again at 0
|
||||
thisChar = 'a';
|
||||
}
|
||||
// print the character
|
||||
lcd.print(thisChar, BYTE);
|
||||
// wait a second:
|
||||
delay(1000);
|
||||
// increment the letter:
|
||||
thisChar++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
ShiftLCD Library - setCursor
|
||||
|
||||
Demonstrates the use a 16x2 LCD display. The ShiftLCD library works with
|
||||
all LCD displays that are compatible with the Hitachi HD44780 driver.
|
||||
There are many of them out there, and you can usually tell them by the
|
||||
16-pin interface.
|
||||
|
||||
This sketch prints to all the positions of the LCD using the
|
||||
setCursor method:
|
||||
|
||||
The circuit:
|
||||
|
||||
---Shift Register 74HC595---
|
||||
* SR Pin 14 to Arduino pin 2
|
||||
* SR Pin 12 to Arduino pin 3
|
||||
* SR Pin 11 to Arduino pin 4
|
||||
* SR Pin 8 to Ground
|
||||
* SR Pin 16 to +5v
|
||||
* SR Pin 13 to Ground
|
||||
* SR Pin 10 to +5v
|
||||
-----Shift Reg to LCD--------
|
||||
* SR Pin 15 to D7
|
||||
* SR Pin 1 to D6
|
||||
* SR Pin 2 to D5
|
||||
* SR Pin 3 to D4
|
||||
* SR Pin 5 to MOSFET gate
|
||||
* SR Pin 6 to Enable
|
||||
* SR Pin 7 to RS
|
||||
-----LCD HD44780-------------
|
||||
* Vss to Ground
|
||||
* Vdd to +5V
|
||||
* Vo to 10k Wiper
|
||||
* R/W to Ground
|
||||
* 5v to +5v
|
||||
* Gnd to MOSFET Drain
|
||||
------N Chanel MOSFET--------
|
||||
* Source to Ground
|
||||
* Gate to SP Pin 5
|
||||
* Drain to LCD Gnd
|
||||
* 1k Resistor Between gate and source
|
||||
|
||||
For a more detailed schematic, please see my blog:
|
||||
|
||||
http://cjparish.blogspot.com/2010/01/controlling-lcd-display-with-shift.html
|
||||
|
||||
Library modified from the original LiquidCrystal Library
|
||||
This example originaly by Tom Igoe, Jul 2009
|
||||
Example modified for use with ShiftLCD
|
||||
Chris Parish, January 12th 2010
|
||||
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
#include <ShiftLCD.h>
|
||||
|
||||
// these constants won't change. But you can change the size of
|
||||
// your LCD using them:
|
||||
const int numRows = 2;
|
||||
const int numCols = 16;
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
ShiftLCD lcd(2, 4, 3);
|
||||
|
||||
void setup() {
|
||||
// set up the LCD's number of rows and columns:
|
||||
lcd.begin(numRows, numCols);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// loop from ASCII 'a' to ASCII 'z':
|
||||
for (int thisLetter = 'a'; thisLetter <= 'z'; thisLetter++) {
|
||||
// loop over the columns:
|
||||
for (int thisCol = 0; thisCol < numRows; thisCol++) {
|
||||
// loop over the rows:
|
||||
for (int thisRow = 0; thisRow < numCols; thisRow++) {
|
||||
// set the cursor position:
|
||||
lcd.setCursor(thisRow,thisCol);
|
||||
// print the letter:
|
||||
lcd.print(thisLetter, BYTE);
|
||||
delay(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user