Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include "Myfun.h"
  2.  
  3. extern volatile uint32_t tick2,lcdvalue;
  4. extern volatile uint8_t stan;
  5.  
  6. int main(void)
  7. {
  8.  
  9.     SysTick_Config(4000000 / 1000);
  10.     Led_Conf();
  11.     Joy_Conf();
  12.     LCD7seg_conf();
  13.  
  14.     while(1)
  15.     {
  16.        
  17.        
  18.         if(stan == 0){
  19.             if(Joy_Read() == Center) stan = 1;
  20.         }
  21.        
  22.         if(stan == 1){
  23.             if(Joy_Read() == Center) stan = 0;
  24.         }
  25.        
  26.  
  27.        
  28.     }
  29. }
  30.  
  31.  
  32. /////////////////// Myfun.c
  33.  
  34. void SysTick_Handler(void) //przrwanie od systick
  35. {
  36.     tick++;
  37.    
  38.     lcdvalue = tick2;
  39.     if(stan == 1){
  40.         tick2++;
  41.         }
  42.        
  43.    
  44.  
  45.     Lcd7seg_WriteNumber();
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement