PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

66 lines
1.6KB

  1. /*
  2. LiquidCrystal Library - Cursor
  3. Demonstrates the use a 16x2 LCD display. The LiquidCrystal
  4. library works with all LCD displays that are compatible with the
  5. Hitachi HD44780 driver. There are many of them out there, and you
  6. can usually tell them by the 16-pin interface.
  7. This sketch prints "Hello World!" to the LCD and
  8. uses the cursor() and noCursor() methods to turn
  9. on and off the cursor.
  10. The circuit:
  11. * LCD RS pin to digital pin 12
  12. * LCD Enable pin to digital pin 11
  13. * LCD D4 pin to digital pin 5
  14. * LCD D5 pin to digital pin 4
  15. * LCD D6 pin to digital pin 3
  16. * LCD D7 pin to digital pin 2
  17. * LCD R/W pin to ground
  18. * 10K resistor:
  19. * ends to +5V and ground
  20. * wiper to LCD VO pin (pin 3)
  21. Library originally added 18 Apr 2008
  22. by David A. Mellis
  23. library modified 5 Jul 2009
  24. by Limor Fried (http://www.ladyada.net)
  25. example added 9 Jul 2009
  26. by Tom Igoe
  27. modified 22 Nov 2010
  28. by Tom Igoe
  29. modified 7 Nov 2016
  30. by Arturo Guadalupi
  31. This example code is in the public domain.
  32. http://www.arduino.cc/en/Tutorial/LiquidCrystalCursor
  33. */
  34. // include the library code:
  35. #include <LiquidCrystal.h>
  36. // initialize the library by associating any needed LCD interface pin
  37. // with the arduino pin number it is connected to
  38. const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
  39. LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
  40. void setup() {
  41. // set up the LCD's number of columns and rows:
  42. lcd.begin(16, 2);
  43. // Print a message to the LCD.
  44. lcd.print("hello, world!");
  45. }
  46. void loop() {
  47. // Turn off the cursor:
  48. lcd.noCursor();
  49. delay(500);
  50. // Turn on the cursor:
  51. lcd.cursor();
  52. delay(500);
  53. }