Skip to content

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

Closed
agdl opened this issue Jul 12, 2016 · 1 comment
Closed

Update CustomCharacter.ino #8

agdl opened this issue Jul 12, 2016 · 1 comment
Assignees
Labels
conclusion: resolved Issue was resolved topic: documentation Related to documentation for the project type: enhancement Proposed improvement

Comments

@agdl
Copy link
Member

agdl commented Jul 12, 2016

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

@per1234
Copy link
Contributor

per1234 commented Apr 19, 2022

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@370e208

From 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 changes

Use consistent number of spaces after period in comment

Status: Resolved (#59)

Add comment re: adaptability to other display dimensions

Status: Superseded (dfdfcb8)

Add comment explaining the purpose of the potentiometer

I 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 list

The 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 date

Status: Resolved (dfdfcb8)

Replace dead link to character generator tool

Status: Superseded (#31)

Resolve ambiguous lcd.write call via type casts

Status: Resolved (dfdfcb8)

Center character

Probably a matter of personal preference. Someone can submit a dedicated PR for it if they think it is important.

Status: Unresolved

arduino/Arduino@20bf2c7

From 20bf2c7d4dd1c567409d56b62dcb43165f6a58c7 Mon Sep 17 00:00:00 2001
From: Nathan Bookham <[email protected]>
Date: Sun, 26 May 2013 18:22:23 +0200
Subject: [PATCH] Update CustomCharacter.ino

Centered line 0 text.
---
 .../LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino b/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino
index 8c680b6db18..3d8cfb6111a 100644
--- a/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino
+++ b/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino
@@ -19,7 +19,7 @@
  * 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)
- * Another 10K potentiometer on pin A0 (Optional)
+ * Another 10K potentiometer with wiper connected to pin analog pin 0 (Optional)
  
  created 21 Mar 2011
  by Tom Igoe
@@ -114,6 +114,7 @@ void setup() {
   // set up the lcd's number of columns and rows: 
   lcd.begin(16, 2);
   // Print a message to the lcd.
+  lcd.setCursor(1, 0);
   lcd.print("I "); 
   lcd.write((byte)0);
   lcd.print(" Arduino! ");

List of proposed changes

Improve description of speed control pot wiring

It seems a reasonable proposal.

If someone wants to submit a PR to add something along these lines, I will consider it.

This information is provided in the companion tutorial introduced by arduino/docs-content#179, which will be published at https://docs.arduino.cc/learn/electronics/lcd-displays#custom-character

Status: Unresolved

Center line 0 text

Probably a matter of personal preference. Someone can submit a dedicated PR for it if they think it is important.

Status: Unresolved

@per1234 per1234 closed this as completed Apr 19, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: documentation Related to documentation for the project type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants