HCMS-2972 (Hewlett Packard)

HCMS-29xx


Připojení k Arduinu

Pin HCMS-2972Název pinu HCMS-2972Pin Arduino
3V LED5V
7GND LEDGND
10V LED5V
14DATA IND6
15RSD7
17CLOCKD8
18CED9
19BLANK
20GND LOGICGND
21SELGND
22V LOGIC5V
24RESETD10
25OSCD8
26DATA OUT

Zdrojový kód pro Arduino

/* Used LEDDisplay library at https://www.pjrc.com/teensy/td_libs_LedDisplay.html */
#include <LedDisplay.h>

// Define pins for the LED display.
// You can change these, just re-wire your board:
#define dataPin 6              // connects to the display's data in
#define registerSelect 7       // the display's register select pin
#define clockPin 8             // the display's clock pin
#define enable 9               // the display's chip enable pin
#define reset 10              // the display's reset pin
#define displayLength 8        // number of characters in the display
String msg = "        HCMS-2972 DEMO ";
unsigned long previousMillis = 0;        // will store last time LED was updated
const long interval = 300;
int i = 0;
int brightness = 3;        // screen brightness

LedDisplay myDisplay = LedDisplay(dataPin, registerSelect, clockPin, enable, reset, displayLength);

void setup() {
  Serial.begin(9600);
  // initialize the display library:
  myDisplay.begin();
  // set the brightness of the display:
  myDisplay.setBrightness(brightness);
}

void loop() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
    if (i < msg.length()) {
      i = i + 1;
    } else {
      i = 0;
    }
  }
  myDisplay.home();
  myDisplay.print(msg.substring(i));
}

Demo video

Leave a Reply