Home - Ynvisible/Ynvisible-ECD-Arduino-Library GitHub Wiki
This is the documentation for the Ynvisible Epaper Library for Arduino. This library allows you to control Ynvisible E-paper displays with Arduino devices.
Installation
Download the library here and install it on the Arduino IDE. Include the library in your sketch with the following:
#include <Ynvisible_ECD-1.0.0.h>
Create an instance of the ECD object
YNV_ECD(char counter_electrode, char counter_enable, char segments[], char number_of_segments, char driving_method, float supply_voltage);
- counter_electrode is the arduino pin number that controls the counter electrode.
- counter_enable is the arduino pin number that enables the counter electrode.
- segments is the array of arduino pin numbers that are connected to the display segments.
- number_of_segments is the number of segments on the display.
- driving_method is the method that the display is going to be drive. Could be 'P' for paralled driving method or 'S' for sequential driving method. 'P' is set by default.
- supply_voltage is the voltage value for driving the display. Is 5.0 volts by default.
Variables of the ECD object
General variables:
Parallel driving method variables:
Sequencial driving method variables:
- int _seq_reduction_time
- int _seq_oxidation_time
- float _seq_reduction_voltage
- float _seq_oxidation_voltage
Refreshing variables:
Functions
Example Code
Example code using the Ynvisible ECD Arduino Library to drive a 1x7 segments display. The step-by-step tutorial can be found here.
#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
}
}