Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. volatile int led1_level; // set this variable to control the duty cycle in 2% steps
  2. void dim_leds() { // call this function from SysTick_Handler()
  3. static int cnt;
  4. cnt = (cnt + 1) % 50;
  5. if(cnt < led1_level)
  6. GPIOG->BSRR = 1 << 13;
  7. else
  8. GPIOG->BSRR = 1 << (13 + 16);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement