PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

61 line
1.5KB

  1. /*
  2. LiquidCrystalFast Library - Cursor
  3. Demonstrates the use a 16x2 LCD display. The LiquidCrystalFast
  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 WR pin to digital pin 10
  13. * LCD Enable pin to digital pin 11
  14. * LCD D4 pin to digital pin 5
  15. * LCD D5 pin to digital pin 4
  16. * LCD D6 pin to digital pin 3
  17. * LCD D7 pin to digital pin 2
  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 25 July 2009
  28. by David A. Mellis
  29. http://www.pjrc.com/teensy/td_libs_LiquidCrystal.html
  30. http://www.arduino.cc/en/Tutorial/LiquidCrystal
  31. */
  32. // include the library code:
  33. #include <LiquidCrystalFast.h>
  34. // initialize the library with the numbers of the interface pins
  35. LiquidCrystalFast lcd(12, 10, 11, 5, 4, 3, 2);
  36. // LCD pins: RS RW EN D4 D5 D6 D7
  37. void setup() {
  38. // set up the LCD's number of rows and columns:
  39. lcd.begin(16, 2);
  40. // Print a message to the LCD.
  41. lcd.print("hello, world!");
  42. }
  43. void loop() {
  44. // Turn off the cursor:
  45. lcd.noCursor();
  46. delay(500);
  47. // Turn on the cursor:
  48. lcd.cursor();
  49. delay(500);
  50. }