PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

51 Zeilen
1.4KB

  1. /*
  2. DogLcd Library - PingPong
  3. Demonstrates the basic use two DOGM text LCD displays.
  4. This sketch prints "Ping" and "Pong" alternately
  5. to the displays.
  6. See the hardware documentation for wiring instuctions
  7. We assume the following pins are connected:
  8. * For boths displays SI pin to digital pin 2
  9. * For boths displays CLK pin to digital pin 3
  10. * For boths displays RS pin to digital pin 4
  11. * For the "Ping" display" the CSB pin is connected to pin 5
  12. * For the "Pong" display" the CSB pin is connected to pin 6
  13. * For boths displays the RESET pin is not used (connected to +5V)
  14. * For boths displays the Backlight switching is not used
  15. Library homepage : http://code.google.com/p/doglcd/
  16. */
  17. // include the library code:
  18. #include <DogLcd.h>
  19. // Ping : initialize the library with the numbers of the interface pins
  20. DogLcd ping(2, 3, 4, 5);
  21. // Pong : initialize the library with the numbers of the interface pins
  22. DogLcd pong(2, 3, 4, 6);
  23. void setup() {
  24. // set up the LCD type and the contrast setting for the ping display
  25. ping.begin(DOG_LCD_M162,0x1F);
  26. // set up the LCD type and the contrast setting for the pong display
  27. pong.begin(DOG_LCD_M162,0x28);
  28. //clear both displays
  29. ping.clear();
  30. pong.clear();
  31. }
  32. void loop() {
  33. //clear the ping-display
  34. ping.print("PING");
  35. delay(1000);
  36. ping.clear();
  37. pong.print("PONG");
  38. delay(1000);
  39. pong.clear();
  40. }