#4 - Grup DISPLAY Uygulaması

<> indirmek için tıklayınız.

 

Uygulamaya ait kodları indirmek için tıklayınız...

 

 

GRUP DISPLAY TANIMLAMALARI

  • #define DISP1               LATA2      //DISP1 pini RA2'ye bagli
  • #define DISP2               LATA3      //DISP2 pini RA3'e bagli
  • #define DISP3               LATA4      //DISP3 pini RA4'e bagli
  • #define DISP4               LATA5      //DISP4 pini RA5'e bagli
  • #define DISP_DATA      LATD        //DATA pinleri PORTD'ye bagli

  • #define TARAMA_ZAMANI 5 //5ms

 

//                             0  ,     1  ,     2  ,     3  ,    4  ,     5  ,     6  ,      7  ,     8  ,    9
char rakam[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F};

 

GRUP DISPLAY FONKSİYONLARI

  • grupDISPLAY_ekrani(int dortBasamakliSayi);
  • grupDISPLAY_digitGoster(char digit, char tekBasamakliSayi);

 

 

MAIN.C - YAZILAN KODLAR


#include "mcc_generated_files/mcc.h" #include "DISPLAY.h" char sayac; int sayi; /* Main application */ void main(void) { // Initialize the device SYSTEM_Initialize(); // If using interrupts in PIC18 High/Low Priority Mode you need to enable the Global High and Low Interrupts // If using interrupts in PIC Mid-Range Compatibility Mode you need to enable the Global and Peripheral Interrupts // Use the following macros to: // Enable the Global Interrupts //INTERRUPT_GlobalInterruptEnable(); // Disable the Global Interrupts //INTERRUPT_GlobalInterruptDisable(); // Enable the Peripheral Interrupts //INTERRUPT_PeripheralInterruptEnable(); // Disable the Peripheral Interrupts //INTERRUPT_PeripheralInterruptDisable(); sayac = 0; sayi = 0; while (1) { // Add your application code // if (BUTON1_GetValue() == 0) { // sayac++; // // if (sayac > 9) { // sayac = 0; // } // while(BUTON1_GetValue() == 0); //Butona bas?l? ise bekle // } // // grupDISPLAY_digitGoster(4,sayac); grupDISPLAY_ekrani(sayi); sayi++; if (sayi > 9999) { sayi = 0; } DELAY_milliseconds(10); } } /** End of File */

UYGULAMAYA AİT DEVRE ŞEMASI

led_uygulamaasi_sema