PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. LiquidCrystalFast Library - display() and noDisplay()
  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 uses the
  8. display() and noDisplay() functions to turn on and off
  9. the display.
  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 display:
  45. lcd.noDisplay();
  46. delay(500);
  47. // Turn on the display:
  48. lcd.display();
  49. delay(500);
  50. }