A 7-segment two digit display, each digit controlled by a 74HC595 integrated. Each digit has a height of 12.7mm with bright red illumination. It can use the screen with a microcontroller, for example Arduino. The monitor connects to the microscope using only three signal cables and two power cables. The operating voltage is between 3-5VDC.
Contoh program
#include // create shift register object (number of shift registers, data pin, clock pin, latch pin) ShiftRegister74HC595 sr (2, 11, 12, 8);
void setup() { //Count from 0 to 'number' countUp(); //Count from 'number' to 0 //countDown(); // <--- Comment countUp and uncomment countDown //Blink 4 times all on and all off. blink(); }
void loop() {
}
void countUp(){ for (int i = 0; i<=number; i++){ //Split number to digits: digit2=i % 10 ; digit1=(i / 10) % 10 ; //Send them to 7 segment displays uint8_t numberToPrint[]= {numberB[digit1],numberB[digit2]}; sr.setAll(numberToPrint); //Reset them for next time digit1=0; digit2=0; delay(1000); // Repeat every 1 sec
void countDown(){ for (number; number>=0; number--){ //Split number to digits: digit2=number % 10 ; digit1=(number / 10) % 10 ; //Send them to 7 segment displays uint8_t numberToPrint[]= {numberB[digit1],numberB[digit2]}; sr.setAll(numberToPrint); //Reset them for next time digit1=0; digit2=0; delay(1000); // Repeat every 1 sec
//Blink void blink(){ for(int i = 0; isr.setAllLow(); // set all pins Low (off) delay(1000); sr.setAllHigh(); // set all pins High (on) delay(1000);