Advertisement
dllbridge

Untitled

Oct 8th, 2020
979
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include    "C:\\dllBridge\\WinLego\\Lego\\Lego.h"
  5. using namespace Lego;
  6.  
  7. #include  <stdio.h>
  8.  
  9.  
  10.  
  11. char sz[123] = "Hello = 123";
  12.  
  13.  
  14. float f = 3.14;
  15.  
  16.  
  17. int cnt  = 0,
  18.     cnt2 = 0;
  19.  
  20. /////////////////////////////////////////////   Эта функция инициализации. Создана специально для Вас ! Она вызывается
  21. void INIT()                                //          (с помощью таймера №1) 1 единственный раз, когда Timer_CLK == 1.
  22. {
  23.    
  24.    
  25. }
  26.  
  27.  
  28. /////////////////////////////////////////////     Эта функция вызывается (с помощью таймера №2) 5 раз в секунду, когда
  29. void START()                               //                                                           Timer_CLK >= 2.
  30. {    
  31.    
  32.      switch(Timer_CLK)
  33.      {
  34.          case 26:  sprintf(sz, "Hello = %.2f", f);
  35.                    Print_2(200, 200, sz);
  36.                    
  37.                    line(20,20, 120, 321);
  38.                    
  39.                    break;
  40.      }
  41.      
  42.      
  43.      
  44.      cnt2++;
  45.      
  46.      if(cnt2> 10)
  47.      {
  48.         cnt2= 0;     cnt ++ ;
  49.         if(cnt > 10) cnt = 0;
  50.      }
  51.      
  52.      PrintSet_2.nTextClr = cnt;
  53.      
  54.      sprintf(sz, "Timer_CLK = %d", Timer_CLK);
  55.      Print_2(200, 230, sz);
  56. }
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement