HCMS-2902 (Agilent Technologies)

HCMS-29xx


Připojení k Arduinu

Pin HCMS-2902Název pinu HCMS-2902Pin Arduino
1DATA OUT
2OSCD8
3V LED5V
4DATA IND6
5RSD7
6CLKD8
7CED9
8BLANK
9GNDGND
10SELGND
11V LOGIC5V
12RESETD10

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 4        // number of characters in the display
String msg = "     HCMS-2902 DEMO     ";
unsigned long previousMillis = 0;        // will store last time LED was updated
const long interval = 300;
int i = 0;
int brightness = 10;        // 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