DSCF5143 LCD char map test


h_ttp://youtu.be/NI4kSMHYu-k

http://youtu.be/NI4kSMHYu-k

.
.

test code for map seraching

/*
LiquidCrystal Library - display() and noDisplay()

Demonstrates the use a 16x2 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 sketch prints "Hello World!" to the LCD and uses the
display() and noDisplay() functions to turn on and off
the display.

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// modified 2013/MAy/11
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);  // change D12, D11 to D7, D6, because Atmega328p D12 = MISO, D11 = MOSI, may interfere with max6675 SPI, test ok

short ascii = 0;

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, xiaolaba");
}

void loop() {
lcd.setCursor(0, 1);
lcd.print( "char(" );
lcd.print(ascii, DEC);
lcd.print( ")" );
lcd.setCursor(13, 1);
lcd.print( "= " );
lcd.print(char(ascii));
ascii++;

// Turn off the display:
//  lcd.noDisplay();
delay(500);
// Turn on the display:
//  lcd.display();
delay(500);
}

create my own symbol of degree


/*
LiquidCrystal Library - display() and noDisplay()

Demonstrates the use a 16x2 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 sketch prints "Hello World!" to the LCD and uses the
display() and noDisplay() functions to turn on and off
the display.

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/

// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//modified 2013/may/11, xiaolaba
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);  // change D12, D11 to D7, D6, because Atmega328p D12 = MISO, D11 = MOSI, may interfere with max6675 SPI, test ok

// http://omerk.github.io/lcdchargen/
// degree symbol
byte customChar[8] = {
0b00000,
0b10000,
0b00110,
0b01001,
0b01000,
0b01000,
0b01001,
0b00110
};

void setup()
{
// create a new custom character
lcd.createChar(0, customChar);

// set up number of columns and rows
lcd.begin(16, 2);

//default position 0, line 0
// Print a message to the LCD.
lcd.print("hello, xiaolaba");

//move to position 0, line 1
lcd.setCursor(0, 1);
// print the custom char to the lcd
lcd.write((uint8_t) 0);
// why typecast? see: http://arduino.cc/forum/index.php?topic=74666.0
lcd.print((uint8_t) 0);

}

void loop()
{

}

廣告

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s