-
Notifications
You must be signed in to change notification settings - Fork 175
Update CustomCharacter.ino #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not sure why the pull request was converted into an issue. I have evaluated the miscellaneous changes that were proposed and found that the valuable ones have already been resubmitted in passing over the 9 years since arduino/Arduino#1436 was submitted. So I am closing this as resolved. arduino/Arduino@370e208From 370e2086848d40b3ae942bc7d5963da4092ac19f Mon Sep 17 00:00:00 2001
From: Nathan Bookham <[email protected]>
Date: Sun, 26 May 2013 15:32:32 +0200
Subject: [PATCH] Update CustomCharacter.ino
Fixed incompatibility with newer Arduino software and updated documentation. Centered custom character animation for a 16x2 display and updated link for character generator as previous link is dead.
---
.../CustomCharacter/CustomCharacter.ino | 27 ++++++++++---------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino b/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino
index d3ce479246d..8c680b6db18 100644
--- a/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino
+++ b/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino
@@ -1,13 +1,14 @@
/*
LiquidCrystal Library - Custom Characters
- Demonstrates how to add custom characters on an LCD display.
+ Demonstrates how to add custom characters on an LCD display.
The LiquidCrystal 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 example uses a 16x2 LCD display, but the code can be easily adapted for different sized displays.
This sketch prints "I <heart> Arduino!" and a little dancing man
- to the LCD.
+ to the LCD. Attaching a potentiometer to Analog pin 0 will allow you to control the speed of the dancing man.
The circuit:
* LCD RS pin to digital pin 12
@@ -17,21 +18,23 @@
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
- * 10K potentiometer:
- * ends to +5V and ground
- * wiper to LCD VO pin (pin 3)
- * 10K poterntiometer on pin A0
+ * 10K potentiometer: ends to +5V and ground, wiper to LCD VO pin (pin 3)
+ * Another 10K potentiometer on pin A0 (Optional)
- created21 Mar 2011
+ created 21 Mar 2011
by Tom Igoe
Based on Adafruit's example at
https://github.com/adafruit/SPI_VFD/blob/master/examples/createChar/createChar.pde
+ updated 26 May 2013
+ by Nathan Bookham
+ Fixed incompatibility with newer Arduino software and updated documentation. Centered custom character animation for a 16x2 display and updated link for character generator as previous link is dead.
+
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/LiquidCrystal
Also useful:
- http://icontexto.com/charactercreator/
+ http://mikeyancey.com/hamcalc/lcd_characters.php (code is buggy - just copy the custom character values.
*/
@@ -112,9 +115,9 @@ void setup() {
lcd.begin(16, 2);
// Print a message to the lcd.
lcd.print("I ");
- lcd.write(0);
+ lcd.write((byte)0);
lcd.print(" Arduino! ");
- lcd.write(1);
+ lcd.write((byte)1);
}
@@ -124,11 +127,11 @@ void loop() {
// map the result to 200 - 1000:
int delayTime = map(sensorReading, 0, 1023, 200, 1000);
// set the cursor to the bottom row, 5th position:
- lcd.setCursor(4, 1);
+ lcd.setCursor(7, 1);
// draw the little man, arms down:
lcd.write(3);
delay(delayTime);
- lcd.setCursor(4, 1);
+ lcd.setCursor(7, 1);
// draw him arms up:
lcd.write(4);
delay(delayTime); List of proposed changesUse consistent number of spaces after period in commentStatus: Resolved (#59) Add comment re: adaptability to other display dimensionsStatus: Superseded (dfdfcb8) Add comment explaining the purpose of the potentiometerI think it would be reasonable to provide this information in some way (in an accompanying tutorial on arduino.cc if not in the comments). If someone wants to submit a PR to add it (hopefully in a less verbose form), I will consider it. Status: Unresolved Merge dimmer pot connections listThe readability was improved by the formatting provided in #18 After that, I don't see any benefit to putting it all on one line. Status: Declined Add missing space to changelog dateStatus: Resolved (dfdfcb8) Replace dead link to character generator toolStatus: Superseded (#31) Resolve ambiguous
|
From @inversesandwich on May 26, 2013 13:32
Fixed incompatibility with newer Arduino software and updated documentation. Centered custom character animation for a 16x2 display and updated link for character generator as previous link is dead.
Copied from original issue: arduino/Arduino/pull/1436
The text was updated successfully, but these errors were encountered: