Tutorial - Ynvisible/Ynvisible-ECD-Arduino-Library GitHub Wiki

REQUIRED HARDWARE

  1. Ynvisible 1x7-segment display
  2. Ynvisible Display Adapter
  3. Arduino Uno
  4. Breadboard
  5. 50kΩ Resistor
  6. 1µF Capacitor
  7. LMC6482 or similar

REQUIRED SOFTWARE

CONNECTING THE COMPONENTS

  1. Connect the Arduino to the display adapter using circuit on the image below.

  1. Insert the display in the connector on the adapter board. Make sure that the display electrodes are well aligned with the connector electrodes. The leftmost display electrode must be connected to the leftmost electrode in the connector.

ADD THE LIBRARY TO THE ARDUINO IDE

  1. Install and open Arduino IDE
  2. Click "Sketch"/"Include Library"/"Add .ZIP Library..." in the main menu
  3. Go to your downloads folder and choose Ynvisible-ECD-Arduino-Library-1.0.0.zip

UPLOAD YOUR FIRST CODE

  1. Connect the Arduino to your computer with a USB cable
  2. Create a new file in the Arduino IDE
  3. Replace the code in the editor with the code below:
#include <Ynvisible_ECD-1.0.0.h>

//Arduino variables
char segments[7] = {4,5,6,7,8,9,10}; //Arduino Pins that are connect to the display segments
char com = 3; //Arduino Pin that is connect to the display common
char com_enable = 11; //Arduino Pin that is connect to the display common enable
char segment_count = 7; //number of segments available                 

//1x7 display electrode pinout configuration
int _1x7_seven_1[7] = {6,5,4,3,2,0,1};

//Seven segment display states
bool _seven_seg_states[10][7]={
  {1,1,1,1,1,1,0}, //#0
  {0,1,1,0,0,0,0}, //#1
  {1,1,0,1,1,0,1}, //#2
  {1,1,1,1,0,0,1}, //#3
  {0,1,1,0,0,1,1}, //#4
  {1,0,1,1,0,1,1}, //#5
  {1,0,1,1,1,1,1}, //#6
  {1,1,1,0,0,0,0}, //#7
  {1,1,1,1,1,1,1}, //#8
  {1,1,1,1,0,1,1}  //#9
};

//ECD Object
YNV_ECD ECD(com, com_enable, segments, segment_count);

//Setup
void setup() {
  TCCR1B = _BV(CS10);      //FAST PWM on counter
  ECD.init();              //Display initiation
}

//Main Loop
void loop() {
  for(int i=0; i<10; i++){  //Counting from 0 to 9.
    bool state[7];          //Initialize the variable state
    for(int j = 0; j<7; j++){
      state[_1x7_seven_1[j]] = _seven_seg_states[i][j]; //Create state array based on the pinout configuration
    }
    ECD.set(state);        //Set display to next state
    delay(5000);           //5 seconds delay between each update
  }
}
  1. Click "upload" (the right arrow on the upper left in the Arduino IDE)
  2. Congratulations! Your display should now count from 0 to 9.