Categories
Price Range
Manufacturers
Themes
    Home > Products > 017- LED > 2pcs Common Cathode 7 Seven Segment - Red LED Display Electronic Component
    2pcs Common Cathode 7 Seven Segment - Red LED Display Electronic Component
    enlarge

    2pcs Common Cathode 7 Seven Segment - Red LED Display Electronic Component

    Rating: 0 out of 100 - based on 0 review(s) | Write Review |
    RM1.60  
    Item details
    SKU: 017-019

    Stock: Stock available

    Brand: 017- LED
      Share This   Add To Facebook   Add To MySpace   

    2pcs Common Cathode 7 Seven Segment - Red LED Display Electronic Component, Paparan 7 segmen merupakan sebuah komponen yang banyak digunakan pada peralatan elektronik seharian. Komponen ini dapat memaparkan nombor digit.

    Secara asasnya, komponen ini mempunyai konsep operasi yang sama seperti diod pemancar cahaya (LED), bezanya cuma komponen ini mempunyai tujuh buah LED yang dipanggil segmen dan disusun membentuk angka 8. Terdapat juga lagi satu LED untuk memaparkan titik perpuluhan pada bahagian bawah kanan komponen ini.

    Baca bebih lanjut di Arduino Bagaimana Untuk Menggunakan Paparan 7 Segmen.

    Lihat lebih lanjut tentang tutorial yang menggunakan paparan 7 segmen di Kit Pembelajaran Kod Warna Perintang Dan Ohm Meter.

    Sambungan Litar

    Kod Arduino

    #define g 13
    #define f 12
    #define a 11
    #define b 10
    #define tp 9
    #define c 8
    #define d 7
    #define e 6
    
    void setup() 
    {
      pinMode(a, OUTPUT);
      pinMode(b, OUTPUT);
      pinMode(c, OUTPUT);
      pinMode(d, OUTPUT);
      pinMode(e, OUTPUT);
      pinMode(f, OUTPUT);
      pinMode(g, OUTPUT);
      pinMode(tp, OUTPUT);
      
    }
    
    void loop() 
    {
      digit0();
      delay(1000);
      digit1();
      delay(1000);
      digit2();
      delay(1000);
      digit3();
      delay(1000);
      digit4();
      delay(1000);
      digit5();
      delay(1000);
      digit6();
      delay(1000);
      digit7();
      delay(1000);
      digit8();
      delay(1000);
      digit9();
      delay(1000);
    }
    
    void digit1()
    {
      digitalWrite(a, LOW);
      digitalWrite(b, HIGH);
      digitalWrite(c, HIGH);
      digitalWrite(d, LOW);
      digitalWrite(e, LOW);
      digitalWrite(f, LOW);
      digitalWrite(g, LOW);
      digitalWrite(tp, LOW);
    }
    
    void digit2()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, HIGH);
      digitalWrite(c, LOW);
      digitalWrite(d, HIGH);
      digitalWrite(e, HIGH);
      digitalWrite(f, LOW);
      digitalWrite(g, HIGH);
      digitalWrite(tp, LOW);
    }
    
    void digit3()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, HIGH);
      digitalWrite(c, HIGH);
      digitalWrite(d, HIGH);
      digitalWrite(e, LOW);
      digitalWrite(f, LOW);
      digitalWrite(g, HIGH);
      digitalWrite(tp, LOW);
    }
    
    void digit4()
    {
      digitalWrite(a, LOW);
      digitalWrite(b, HIGH);
      digitalWrite(c, HIGH);
      digitalWrite(d, LOW);
      digitalWrite(e, LOW);
      digitalWrite(f, HIGH);
      digitalWrite(g, HIGH);
      digitalWrite(tp, LOW);
    }
    
    void digit5()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, LOW);
      digitalWrite(c, HIGH);
      digitalWrite(d, HIGH);
      digitalWrite(e, LOW);
      digitalWrite(f, HIGH);
      digitalWrite(g, HIGH);
      digitalWrite(tp, LOW);
    }
    
    void digit6()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, LOW);
      digitalWrite(c, HIGH);
      digitalWrite(d, HIGH);
      digitalWrite(e, HIGH);
      digitalWrite(f, HIGH);
      digitalWrite(g, HIGH);
      digitalWrite(tp, LOW);
    }
    
    void digit7()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, HIGH);
      digitalWrite(c, HIGH);
      digitalWrite(d, LOW);
      digitalWrite(e, LOW);
      digitalWrite(f, LOW);
      digitalWrite(g, LOW);
      digitalWrite(tp, LOW);
    }
    
    void digit8()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, HIGH);
      digitalWrite(c, HIGH);
      digitalWrite(d, HIGH);
      digitalWrite(e, HIGH);
      digitalWrite(f, HIGH);
      digitalWrite(g, HIGH);
      digitalWrite(tp, LOW);
    }
    
    void digit9()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, HIGH);
      digitalWrite(c, HIGH);
      digitalWrite(d, HIGH);
      digitalWrite(e, LOW);
      digitalWrite(f, HIGH);
      digitalWrite(g, HIGH);
      digitalWrite(tp, LOW);
    }
    
    void digit0()
    {
      digitalWrite(a, HIGH);
      digitalWrite(b, HIGH);
      digitalWrite(c, HIGH);
      digitalWrite(d, HIGH);
      digitalWrite(e, HIGH);
      digitalWrite(f, HIGH);
      digitalWrite(g, LOW);
      digitalWrite(tp, LOW);
    }