Arduino Playground is read-only starting December 31st, 2018. For more info please look at this Forum Post

TimerFa is a class used to do non-simultaneous repetitive tasks. for example, a temperature sensor read for 2 seconds. Write an LCD for 1 second. You can use it to read different light sensors in 10 seconds to perform different tasks in different time periods.

Source address https://github.com/fatihaslamaci/TimerFa.git

TimerFa, eş zamanlı olmayan tekrarlı işleri yaptırmak için kullanılan bir sınıftır dır. örneğin 2 saniyede bir ısı sensörü okunsun. 1 saniyede bir LCD ye yazı yazsın. 10 saniyede bir ışık sensörü nü okusun şeklinde farklı zaman dilimlerinde farklı işler yaptırmak için kullanabilirsiniz.

Sample Code


  1. #include <TimerFa.h>
  2. TimerFa TimerLed1;
  3. TimerFa TimerLed2;
  4. int Led1=13;
  5. int Led2=9;
  6. void setup(void)
  7. {
  8.   pinMode(Led1, OUTPUT);
  9.   pinMode(Led2, OUTPUT);
  10. }
  11. void loop(void)
  12. {
  13.   if (TimerLed1.MicrosaniyedeBir(1000000L)) {
  14.        digitalWrite(Led1,!digitalRead(Led1) );
  15.   }
  16.   if (TimerLed2.MicrosaniyedeBir(500000L)) {
  17.       digitalWrite(Led2,!digitalRead(Led2) );
  18.   }
  19. }