REQUIRED HARDWARE
- Ynvisible 1x7-segment display
- Ynvisible Display Adapter
- Arduino Uno
- Breadboard
- 50kΩ Resistor
- 1µF Capacitor
- LMC6482 or similar
REQUIRED SOFTWARE
CONNECTING THE COMPONENTS
- Connect the Arduino to the display adapter using circuit on the image below.
- 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
- Install and open Arduino IDE
- Click "Sketch"/"Include Library"/"Add .ZIP Library..." in the main menu
- Go to your downloads folder and choose Ynvisible-ECD-Arduino-Library-1.0.0.zip
UPLOAD YOUR FIRST CODE
- Connect the Arduino to your computer with a USB cable
- Create a new file in the Arduino IDE
- 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
}
}
- Click "upload" (the right arrow on the upper left in the Arduino IDE)
- Congratulations! Your display should now count from 0 to 9.