mikroc-in-library-preparation

Lesson1 – MikroC in LIBRARY PREPARATION

This post is also available in: Türkçe Azerbaycan Türkcesi Русский

  • Properties of the library
    • Hardware Control – Example ,  LCD ,SDcard etc.
    • Code prevents confusion
    • Professional software
    • The library is portable and flexile
  • You can ask your questions in the comments !

Code

extern sfr sbit LED;
extern sfr sbit LED_TRIS;
#define saniye 1000

//fonksyonlar.c Code
#include "header.h"
void LED_YAK(unsigned char sure)
{
LED_TRIS=0;
LED=0;
vdelay_ms(sure*saniye);
LED=1;
}

void LED_FLASH(unsigned char flash_sure , unsigned char yanma_suresi)
{
int i;
LED_TRIS=0;
for(i=0;i<yanma_suresi;i++)
{
LED=0;
vdelay_ms(flash_sure*saniye);
LED=1;
vdelay_ms(flash_sure*saniye);
}
}

//led_yak.c Code
#include "fonksyonlar.c"

sbit LED at RB4_bit;
sbit LED_TRIS at TRISB4_bit;

main()
{
LED_YAK(5);
delay_ms(2000);
LED_FLASH(2,10);
}

Important Notes 

  1. Libraries should be designed to provide all of the conditions
  2. Add your comments to the certainly functions
  3. Check the your continuous software, provide RAM optimization, remember that MCU (microcontroller) programs 1kb is a very large area ;)


About ERCAN123 KOÇLAR

Çalışmalarım çocukken başladı kolonyalı kağıtları yakmak, ilaçları birbirine katmak gibi değişik deneylerim vardı. Kimya kitabında elektroliz ile suyun hidrojen ve oksijene ayrıldığı ve hidrojenin yandığını yazıyordu, o zamanlarda aklım almıyordu sudan nasıl yanan….Devamını okumak için tıklayınız ;)