Timers.c 757 B

12345678910111213141516171819202122232425262728293031
  1. // Install two timers with counter variables
  2. #define USE_TI89 // Compile for TI-89
  3. #define USE_TI92PLUS // Compile for TI-92 Plus
  4. #define USE_V200 // Compile for V200
  5. #define MIN_AMS 100 // Compile for AMS 1.00 or higher
  6. #define SAVE_SCREEN // Save/Restore LCD Contents
  7. #include <tigcclib.h> // Include All Header Files
  8. CALLBACK void Action1(void)
  9. {
  10. static int Counter = 0;
  11. printf_xy (50, 50, "Counter1 = %d ", ++Counter);
  12. }
  13. CALLBACK void Action2(void)
  14. {
  15. static int Counter = 0;
  16. printf_xy (70, 70, "Counter2 = %d ", ++Counter);
  17. }
  18. void _main(void)
  19. {
  20. OSVRegisterTimer (1, 3, Action1);
  21. OSVRegisterTimer (2, 10, Action2);
  22. ngetchx ();
  23. OSVFreeTimer (1);
  24. OSVFreeTimer (2);
  25. }