PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

49 行
1.4KB

  1. /*
  2. HCMS Display
  3. Language: Arduino/Wiring
  4. Displays an analog value on an Avago HCMS-297x display
  5. String library based on the Wiring String library:
  6. http://wiring.org.co/learning/reference/String.html
  7. created 12 Jun. 2008
  8. modified 17 Apr 2009
  9. by Tom Igoe
  10. */
  11. #include <LedDisplay.h>
  12. // Define pins for the LED display.
  13. // You can change these, just re-wire your board:
  14. #define dataPin 6 // connects to the display's data in
  15. #define registerSelect 7 // the display's register select pin
  16. #define clockPin 8 // the display's clock pin
  17. #define enable 9 // the display's chip enable pin
  18. #define reset 10 // the display's reset pin
  19. #define displayLength 8 // number of characters in the display
  20. // create am instance of the LED display library:
  21. LedDisplay myDisplay = LedDisplay(dataPin, registerSelect, clockPin,
  22. enable, reset, displayLength);
  23. int brightness = 15; // screen brightness
  24. void setup() {
  25. // initialize the display library:
  26. myDisplay.begin();
  27. // set the brightness of the display:
  28. myDisplay.setBrightness(brightness);
  29. Serial.begin(9600);
  30. Serial.println(myDisplay.version(), DEC);
  31. }
  32. void loop() {
  33. // set the cursor first character
  34. myDisplay.home();
  35. myDisplay.print("A0: ");
  36. myDisplay.print(analogRead(0), DEC);
  37. myDisplay.print(" ");
  38. }