This post is also available in: Türkçe (Turkish)
- 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
- Libraries should be designed to provide all of the conditions
- Add your comments to the certainly functions
- Check the your continuous software, provide RAM optimization, remember that MCU (microcontroller) programs 1kb is a very large area ;)
This post is also available in: Türkçe (Turkish)